পৃষ্ঠাসমূহ

Search Your Article

CS

 

Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.

At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.

What We Offer:

  • 📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.

  • 💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.

  • 🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.

  • 🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.

    Latest world News 

     

Our Vision

To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.

Why Choose Us?

✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing

We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.

📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.

Pageviews

Thursday, March 30, 2017

PyGTK - File Chooser Dialog

This dialog is useful to let the user select the location and the name of file that needs to be opened or saved. It embeds FileChooserWidget and provides OK and CANCEL buttons in the action_area.
The following is a constructor of the gtk.FileChooserDialog class −
Dlg=gtk.FileChooserDialog (title = None, parent = None, 
   action = gtk.FILE_CHOOSER_ACTION_OPEN,  buttons = None, backend = None)
The parameters are −

title This is the title of the dialog
parent The transient parent of the dialog, or None
action The open or save mode for the dialog
buttons This is a tuple containing button label-response id pairs or None
backend The name of the specific filesystem backend to use.
The following are the action modes −
  • gtk.FILE_CHOOSER_ACTION_OPEN
  • gtk.FILE_CHOOSER_ACTION_SAVE
  • gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER
  • gtk.FILE_CHOOSER_ACTION_CREATE_FOLDER
If it is desired to restrict the types of files to be available for display, an object of the gtk.FileFilter can be applied by using the add_filter() method.
If the FileChooserDialog menu button is clicked, the following callback function is run.
def on_file(self, widget):
   dlg = gtk.FileChooserDialog("Open..", None, gtk.FILE_CHOOSER_ACTION_OPEN,
      (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK))
   response = dlg.run()
   self.text.set_text(dlg.get_filename())
   dlg.destroy()
The file is selected from the dialog −
File Chooser Open The selected file is displayed on the label on the toplevel gtk.Window −
File Dialog Boxes

No comments:

Post a Comment