gtk.RecentChooserDialog — Displays recently used files in a dialog (new in PyGTK 2.10)
class gtk.RecentChooserDialog(gtk.Dialog, gtk.RecentChooser): |
+-- gobject.GObject +-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Bin +-- gtk.Window +-- gtk.Dialog +-- gtk.RecentChooserDialog (implements gtk.RecentChooser) |
gobject.GObject Signal Prototypes
gtk.RecentChooserDialog is a dialog box suitable for displaying the recently used documents. This widgets works by putting a gtk.RecentChooserWidget inside a gtk.Dialog. It exposes the gtk.RecentChooser interface, so you can use all the gtk.RecentChooser methods on the recent chooser dialog as well as those for gtk.Dialog.
Note that gtk.RecentChooserDialog does not have any methods of its own. Instead, you should use the methods that work on a gtk.RecentChooser.
Example 4. Typical usage
In the simplest of cases, you can use the following code to use a gtk.RecentChooserDialog to select a recently used file:
dialog = gtk.RecentChooserDialog("Recent Documents", parent_window, None, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_ACCEPT)) if dialog.run() == gtk.RESPONSE_ACCEPT: info = dialog.get_current_item () open_file(info.get_uri()) dialog.destroy() |
Recently used files are supported since GTK+ 2.10.
|
title : | Title of the dialog, or None |
parent : | Transient parent of the dialog, or None, |
manager : | a gtk.RecentManager, or None, |
buttons : | a sequence of text-response pairs |
Returns : | a new gtk.RecentChooserDialog |
This constructor is available in PyGTK 2.10 and above.
Creates a new gtk.RecentChooserDialog with the title text specified by title (or None for the default title; see gtk.Window.set_title()) and transient parent window specified by parent (or None for none; see gtk.Window.set_transient_for()). manager specifies a gtk.RecentManager object (or None). buttons is a sequence of button text/response ID pairs should be listed, or None (the default value) if no buttons are needed. The button text can be either a stock ID such as gtk.STOCK_OK, or some arbitrary text. A response ID can be any positive number, or one of the pre-defined GTK Response Type Constants. This constructor is analogous to gtk.Dialog.