Gtk.RecentChooserMenu

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Activatable Gtk.Activatable GObject.GInterface->Gtk.Activatable Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.RecentChooser Gtk.RecentChooser GObject.GInterface->Gtk.RecentChooser GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.RecentChooserMenu Gtk.RecentChooserMenu Gtk.Activatable->Gtk.RecentChooserMenu Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.MenuShell Gtk.MenuShell Gtk.Container->Gtk.MenuShell Gtk.Menu Gtk.Menu Gtk.Menu->Gtk.RecentChooserMenu Gtk.MenuShell->Gtk.Menu Gtk.RecentChooser->Gtk.RecentChooserMenu Gtk.Widget->Gtk.Container

Subclasses:None

Properties

Inherited:Gtk.Menu (12), Gtk.MenuShell (1), Gtk.Container (3), Gtk.Widget (39), Gtk.Activatable (2), Gtk.RecentChooser (10)
Name Type Flags Short Description
show-numbers bool r/w/en Whether the items should be displayed with a number

Child Properties

Inherited:Gtk.Menu (4)

Style Properties

Inherited:Gtk.Menu (7), Gtk.Widget (17)

Fields

Inherited:Gtk.Menu (2), Gtk.MenuShell (8), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1), Gtk.RecentChooser (2)
Name Type Access Description
parent_instance Gtk.Menu r  

Class Details

class Gtk.RecentChooserMenu(**kwargs)
Bases:Gtk.Menu, Gtk.Activatable, Gtk.RecentChooser
Abstract:No
Structure:Gtk.RecentChooserMenuClass

Gtk.RecentChooserMenu is a widget suitable for displaying recently used files inside a menu. It can be used to set a sub-menu of a Gtk.MenuItem using Gtk.MenuItem.set_submenu(), or as the menu of a Gtk.MenuToolButton.

Note that Gtk.RecentChooserMenu does not have any methods of its own. Instead, you should use the functions that work on a Gtk.RecentChooser.

Note also that Gtk.RecentChooserMenu does not support multiple filters, as it has no way to let the user choose between them as the Gtk.RecentChooserWidget and Gtk.RecentChooserDialog widgets do. Thus using Gtk.RecentChooser.add_filter() on a Gtk.RecentChooserMenu widget will yield the same effects as using Gtk.RecentChooser.set_filter(), replacing any currently set filter with the supplied filter; Gtk.RecentChooser.remove_filter() will remove any currently set Gtk.RecentFilter object and will unset the current filter; Gtk.RecentChooser.list_filters() will return a list containing a single Gtk.RecentFilter object.

Recently used files are supported since GTK+ 2.10.

classmethod new()[source]
Returns:a new Gtk.RecentChooserMenu
Return type:Gtk.Widget

Creates a new Gtk.RecentChooserMenu widget.

This kind of widget shows the list of recently used resources as a menu, each item as a menu item. Each item inside the menu might have an icon, representing its MIME type, and a number, for mnemonic access.

This widget implements the Gtk.RecentChooser interface.

This widget creates its own Gtk.RecentManager object. See the Gtk.RecentChooserMenu.new_for_manager() function to know how to create a Gtk.RecentChooserMenu widget bound to another Gtk.RecentManager object.

New in version 2.10.

classmethod new_for_manager(manager)[source]
Parameters:manager (Gtk.RecentManager) – a Gtk.RecentManager
Returns:a new Gtk.RecentChooserMenu, bound to manager.
Return type:Gtk.Widget

Creates a new Gtk.RecentChooserMenu widget using manager as the underlying recently used resources manager.

This is useful if you have implemented your own recent manager, or if you have a customized instance of a Gtk.RecentManager object or if you wish to share a common Gtk.RecentManager object among multiple Gtk.RecentChooser widgets.

New in version 2.10.

get_show_numbers()[source]
Returns:True if numbers should be shown.
Return type:bool

Returns the value set by Gtk.RecentChooserMenu.set_show_numbers().

New in version 2.10.

set_show_numbers(show_numbers)[source]
Parameters:show_numbers (bool) – whether to show numbers

Sets whether a number should be added to the items of self. The numbers are shown to provide a unique character for a mnemonic to be used inside ten menu item’s label. Only the first the items get a number to avoid clashes.

New in version 2.10.

Property Details

Gtk.RecentChooserMenu.props.show_numbers
Name:show-numbers
Type:bool
Default Value:False
Flags:READABLE, WRITABLE, EXPLICIT_NOTIFY

Whether the first ten items in the menu should be prepended by a number acting as a unique mnemonic.

New in version 2.10.