RecentChooserMenu

GtkRecentChooserMenu is a widget suitable for displaying recently used files inside a menu. It can be used to set a sub-menu of a GtkMenuItem using gtk_menu_item_set_submenu(), or as the menu of a GtkMenuToolButton.

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

Note also that GtkRecentChooserMenu does not support multiple filters, as it has no way to let the user choose between them as the GtkRecentChooserWidget and GtkRecentChooserDialog widgets do. Thus using gtk_recent_chooser_add_filter() on a GtkRecentChooserMenu widget will yield the same effects as using gtk_recent_chooser_set_filter(), replacing any currently set filter with the supplied filter; gtk_recent_chooser_remove_filter() will remove any currently set GtkRecentFilter object and will unset the current filter; gtk_recent_chooser_list_filters() will return a list containing a single GtkRecentFilter object.

Recently used files are supported since GTK+ 2.10.

Constructors

this
this(GtkRecentChooserMenu* gtkRecentChooserMenu)

Sets our main struct and passes it to the parent class

this
this()

Creates a new GtkRecentChooserMenu 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 GtkRecentChooser interface. This widget creates its own GtkRecentManager object. See the gtk_recent_chooser_menu_new_for_manager() function to know how to create a GtkRecentChooserMenu widget bound to another GtkRecentManager object. Since 2.10

this
this(RecentManager manager)

Creates a new GtkRecentChooserMenu 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 GtkRecentManager object or if you wish to share a common GtkRecentManager object among multiple GtkRecentChooser widgets. Since 2.10

Members

Functions

getRecentChooserMenuStruct
GtkRecentChooserMenu* getRecentChooserMenuStruct()

Get the main Gtk struct

getShowNumbers
int getShowNumbers()

Returns the value set by gtk_recent_chooser_menu_set_show_numbers(). Since 2.10

getStruct
void* getStruct()

the main Gtk struct as a void*

setShowNumbers
void setShowNumbers(int showNumbers)

Sets whether a number should be added to the items of menu. 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. Since 2.10

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin ActivatableT!(GtkRecentChooserMenu)
Undocumented in source.
__anonymous
mixin RecentChooserT!(GtkRecentChooserMenu)
Undocumented in source.

Variables

gtkRecentChooserMenu
GtkRecentChooserMenu* gtkRecentChooserMenu;

the main Gtk struct

Inherited Members

From Menu

gtkMenu
GtkMenu* gtkMenu;

the main Gtk struct

getMenuStruct
GtkMenu* getMenuStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
popup
void popup(guint button, guint32 activateTime)

Popups up this menu

appendSubmenu
Menu appendSubmenu(string label)

Creates and append a submenu to this menu. This menu item that actualy has the sub menu is also created.

appendSubmenu
void appendSubmenu(string label, Menu submenu)
prependSubmenu
Menu prependSubmenu(string label)
connectedSignals
int[string] connectedSignals;
onMoveScrollListeners
void delegate(GtkScrollType, Menu)[] onMoveScrollListeners;
Undocumented in source.
addOnMoveScroll
void addOnMoveScroll(void delegate(GtkScrollType, Menu) dlg, ConnectFlags connectFlags)
callBackMoveScroll
void callBackMoveScroll(GtkMenu* menuStruct, GtkScrollType scrollType, Menu _menu)
Undocumented in source. Be warned that the author may not have intended to support it.
setScreen
void setScreen(Screen screen)

Sets the GdkScreen on which the menu will be displayed. Since 2.2

reorderChild
void reorderChild(Widget child, int position)

Moves child to a new position in the list of menu children.

attach
void attach(Widget child, uint leftAttach, uint rightAttach, uint topAttach, uint bottomAttach)

Adds a new GtkMenuItem to a (table) menu. The number of 'cells' that an item will occupy is specified by left_attach, right_attach, top_attach and bottom_attach. These each represent the leftmost, rightmost, uppermost and lower column and row numbers of the table. (Columns and rows are indexed from zero). Note that this function is not related to gtk_menu_detach(). Since 2.4

popupForDevice
void popupForDevice(Device device, Widget parentMenuShell, Widget parentMenuItem, GtkMenuPositionFunc func, void* data, GDestroyNotify destroy, uint button, uint activateTime)

Displays a menu and makes it available for selection. Applications can use this function to display context-sensitive menus, and will typically supply NULL for the parent_menu_shell, parent_menu_item, func, data and destroy parameters. The default menu positioning function will position the menu at the current position of device (or its corresponding pointer). The button parameter should be the mouse button pressed to initiate the menu popup. If the menu popup was initiated by something other than a mouse button press, such as a mouse button release or a keypress, button should be 0. The activate_time parameter is used to conflict-resolve initiation of concurrent requests for mouse/keyboard grab requests. To function properly, this needs to be the time stamp of the user event (such as a mouse click or key press) that caused the initiation of the popup. Only if no such event is available, gtk_get_current_event_time() can be used instead.

popup
void popup(Widget parentMenuShell, Widget parentMenuItem, GtkMenuPositionFunc func, void* data, uint button, uint activateTime)

Displays a menu and makes it available for selection. Applications can use this function to display context-sensitive menus, and will typically supply NULL for the parent_menu_shell, parent_menu_item, func and data parameters. The default menu positioning function will position the menu at the current mouse cursor position. The button parameter should be the mouse button pressed to initiate the menu popup. If the menu popup was initiated by something other than a mouse button press, such as a mouse button release or a keypress, button should be 0. The activate_time parameter is used to conflict-resolve initiation of concurrent requests for mouse/keyboard grab requests. To function properly, this needs to be the timestamp of the user event (such as a mouse click or key press) that caused the initiation of the popup. Only if no such event is available, gtk_get_current_event_time() can be used instead.

setAccelGroup
void setAccelGroup(AccelGroup accelGroup)

Set the GtkAccelGroup which holds global accelerators for the menu. This accelerator group needs to also be added to all windows that this menu is being used in with gtk_window_add_accel_group(), in order for those windows to support all the accelerators contained in this group.

getAccelGroup
AccelGroup getAccelGroup()

Gets the GtkAccelGroup which holds global accelerators for the menu. See gtk_menu_set_accel_group().

setAccelPath
void setAccelPath(string accelPath)

Sets an accelerator path for this menu from which accelerator paths for its immediate children, its menu items, can be constructed. The main purpose of this function is to spare the programmer the inconvenience of having to call gtk_menu_item_set_accel_path() on each menu item that should support runtime user changable accelerators. Instead, by just calling gtk_menu_set_accel_path() on their parent, each menu item of this menu, that contains a label describing its purpose, automatically gets an accel path assigned. For example, a menu containing menu items "New" and "Exit", will, after gtk_menu_set_accel_path (menu, "<Gnumeric-Sheet>/File");

getAccelPath
string getAccelPath()

Retrieves the accelerator path set on the menu. Since 2.14

setTitle
void setTitle(string title)

Warning gtk_menu_set_title is deprecated and should not be used in newly-written code. 3.10 Sets the title string for the menu. The title is displayed when the menu is shown as a tearoff menu. If title is NULL, the menu will see if it is attached to a parent menu item, and if so it will try to use the same text as that menu item's label.

getTitle
string getTitle()

Warning gtk_menu_get_title is deprecated and should not be used in newly-written code. 3.10 Returns the title of the menu. See gtk_menu_set_title().

setMonitor
void setMonitor(int monitorNum)

Informs GTK+ on which monitor a menu should be popped up. See gdk_screen_get_monitor_geometry(). This function should be called from a GtkMenuPositionFunc if the menu should not appear on the same monitor as the pointer. This information can't be reliably inferred from the coordinates returned by a GtkMenuPositionFunc, since, for very long menus, these coordinates may extend beyond the monitor boundaries or even the screen boundaries. Since 2.4

getMonitor
int getMonitor()

Retrieves the number of the monitor on which to show the menu. Since 2.14

getTearoffState
int getTearoffState()

Warning gtk_menu_get_tearoff_state is deprecated and should not be used in newly-written code. 3.10 Returns whether the menu is torn off. See gtk_menu_set_tearoff_state().

setReserveToggleSize
void setReserveToggleSize(int reserveToggleSize)

Sets whether the menu should reserve space for drawing toggles or icons, regardless of their actual presence. Since 2.18

getReserveToggleSize
int getReserveToggleSize()

Returns whether the menu reserves space for toggles and icons, regardless of their actual presence. Since 2.18

popdown
void popdown()

Removes the menu from the screen.

reposition
void reposition()

Repositions the menu according to its position function.

getActive
Widget getActive()

Returns the selected menu item from the menu. This is used by the GtkComboBox.

setActive
void setActive(uint index)

Selects the specified menu item within the menu. This is used by the GtkComboBox and should not be used by anyone else.

setTearoffState
void setTearoffState(int tornOff)

Warning gtk_menu_set_tearoff_state is deprecated and should not be used in newly-written code. 3.10 Changes the tearoff state of the menu. A menu is normally displayed as drop down menu which persists as long as the menu is active. It can also be displayed as a tearoff menu which persists until it is closed or reattached.

attachToWidget
void attachToWidget(Widget attachWidget, GtkMenuDetachFunc detacher)

Attaches the menu to the widget and provides a callback function that will be invoked when the menu calls gtk_menu_detach() during its destruction. If the menu is attached to the widget then it will be destroyed when the widget is destroyed, as if it was a child widget. An attached menu will also move between screens correctly if the widgets moves between screens.

detach
void detach()

Detaches the menu from the widget to which it had been attached. This function will call the callback function, detacher, provided when the gtk_menu_attach_to_widget() function was called.

getAttachWidget
Widget getAttachWidget()

Returns the GtkWidget that the menu is attached to.

getForAttachWidget
ListG getForAttachWidget(Widget widget)

Returns a list of the menus which are attached to this widget. This list is owned by GTK+ and must not be modified. Since 2.6

From ActivatableIF

getActivatableTStruct
GtkActivatable* getActivatableTStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

doSetRelatedAction
void doSetRelatedAction(Action action)

Warning gtk_activatable_do_set_related_action is deprecated and should not be used in newly-written code. 3.10 This is a utility function for GtkActivatable implementors. When implementing GtkActivatable you must call this when handling changes of the "related-action", and you must also use this to break references in GObject->dispose(). This function adds a reference to the currently set related action for you, it also makes sure the GtkActivatable->update() method is called when the related GtkAction properties change and registers to the action's proxy list. Note Be careful to call this before setting the local copy of the GtkAction property, since this function uses gtk_activatable_get_related_action() to retrieve the previous action Since 2.16

getRelatedAction
Action getRelatedAction()

Warning gtk_activatable_get_related_action is deprecated and should not be used in newly-written code. 3.10 Gets the related GtkAction for activatable. Since 2.16

getUseActionAppearance
int getUseActionAppearance()

Warning gtk_activatable_get_use_action_appearance is deprecated and should not be used in newly-written code. 3.10 Gets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance. Since 2.16

syncActionProperties
void syncActionProperties(Action action)

Warning gtk_activatable_sync_action_properties is deprecated and should not be used in newly-written code. 3.10 This is called to update the activatable completely, this is called internally when the "related-action" property is set or unset and by the implementing class when "use-action-appearance" changes. Since 2.16

setRelatedAction
void setRelatedAction(Action action)

Warning gtk_activatable_set_related_action is deprecated and should not be used in newly-written code. 3.10 Sets the related action on the activatable object. Note GtkActivatable implementors need to handle the "related-action" property and call gtk_activatable_do_set_related_action() when it changes. Since 2.16

setUseActionAppearance
void setUseActionAppearance(int useAppearance)

Warning gtk_activatable_set_use_action_appearance is deprecated and should not be used in newly-written code. 3.10 Sets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance Note GtkActivatable implementors need to handle the "use-action-appearance" property and call gtk_activatable_sync_action_properties() to update activatable if needed. Since 2.16

From RecentChooserIF

getRecentChooserTStruct
GtkRecentChooser* getRecentChooserTStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

onItemActivatedListeners
void delegate(RecentChooserIF)[] onItemActivatedListeners [@property getter]
addOnItemActivated
void addOnItemActivated(void delegate(RecentChooserIF) dlg, ConnectFlags connectFlags)

This signal is emitted when the user "activates" a recent item in the recent chooser. This can happen by double-clicking on an item in the recently used resources list, or by pressing Enter. Since 2.10

onSelectionChangedListeners
void delegate(RecentChooserIF)[] onSelectionChangedListeners [@property getter]
Undocumented in source.
addOnSelectionChanged
void addOnSelectionChanged(void delegate(RecentChooserIF) dlg, ConnectFlags connectFlags)

This signal is emitted when there is a change in the set of selected recently used resources. This can happen when a user modifies the selection with the mouse or the keyboard, or when explicitely calling functions to change the selection. Since 2.10 See Also GtkRecentManager, GtkRecentChooserDialog, GtkRecentChooserWidget, GtkRecentChooserMenu

setShowPrivate
void setShowPrivate(int showPrivate)

Whether to show recently used resources marked registered as private. Since 2.10

getShowPrivate
int getShowPrivate()

Returns whether chooser should display recently used resources registered as private. Since 2.10

setShowNotFound
void setShowNotFound(int showNotFound)

Sets whether chooser should display the recently used resources that it didn't find. This only applies to local resources. Since 2.10

getShowNotFound
int getShowNotFound()

Retrieves whether chooser should show the recently used resources that were not found. Since 2.10

setShowIcons
void setShowIcons(int showIcons)

Sets whether chooser should show an icon near the resource when displaying it. Since 2.10

getShowIcons
int getShowIcons()

Retrieves whether chooser should show an icon near the resource. Since 2.10

setSelectMultiple
void setSelectMultiple(int selectMultiple)

Sets whether chooser can select multiple items. Since 2.10

getSelectMultiple
int getSelectMultiple()

Gets whether chooser can select multiple items. Since 2.10

setLocalOnly
void setLocalOnly(int localOnly)

Sets whether only local resources, that is resources using the file:// URI scheme, should be shown in the recently used resources selector. If local_only is TRUE (the default) then the shown resources are guaranteed to be accessible through the operating system native file system. Since 2.10

getLocalOnly
int getLocalOnly()

Gets whether only local resources should be shown in the recently used resources selector. See gtk_recent_chooser_set_local_only() Since 2.10

setLimit
void setLimit(int limit)

Sets the number of items that should be returned by gtk_recent_chooser_get_items() and gtk_recent_chooser_get_uris(). Since 2.10

getLimit
int getLimit()

Gets the number of items returned by gtk_recent_chooser_get_items() and gtk_recent_chooser_get_uris(). Since 2.10

setShowTips
void setShowTips(int showTips)

Sets whether to show a tooltips containing the full path of each recently used resource in a GtkRecentChooser widget. Since 2.10

getShowTips
int getShowTips()

Gets whether chooser should display tooltips containing the full path of a recently user resource. Since 2.10

setSortType
void setSortType(GtkRecentSortType sortType)

Changes the sorting order of the recently used resources list displayed by chooser. Since 2.10

getSortType
GtkRecentSortType getSortType()

Gets the value set by gtk_recent_chooser_set_sort_type(). Since 2.10

setSortFunc
void setSortFunc(GtkRecentSortFunc sortFunc, void* sortData, GDestroyNotify dataDestroy)

Sets the comparison function used when sorting to be sort_func. If the chooser has the sort type set to GTK_RECENT_SORT_CUSTOM then the chooser will sort using this function. To the comparison function will be passed two GtkRecentInfo structs and sort_data; sort_func should return a positive integer if the first item comes before the second, zero if the two items are equal and a negative integer if the first item comes after the second. Since 2.10

setCurrentUri
int setCurrentUri(string uri)

Sets uri as the current URI for chooser. Since 2.10

getCurrentUri
string getCurrentUri()

Gets the URI currently selected by chooser. Since 2.10

getCurrentItem
RecentInfo getCurrentItem()

Gets the GtkRecentInfo currently selected by chooser. Since 2.10

selectUri
int selectUri(string uri)

Selects uri inside chooser. Since 2.10

unselectUri
void unselectUri(string uri)

Unselects uri inside chooser. Since 2.10

selectAll
void selectAll()

Selects all the items inside chooser, if the chooser supports multiple selection. Since 2.10

unselectAll
void unselectAll()

Unselects all the items inside chooser. Since 2.10

getItems
ListG getItems()

Gets the list of recently used resources in form of GtkRecentInfo objects. The return value of this function is affected by the "sort-type" and "limit" properties of chooser. Since 2.10

getUris
string[] getUris()

Gets the URI of the recently used resources. The return value of this function is affected by the "sort-type" and "limit" properties of chooser. Since the returned array is NULL terminated, length may be NULL. Since 2.10

addFilter
void addFilter(RecentFilter filter)

Adds filter to the list of GtkRecentFilter objects held by chooser. If no previous filter objects were defined, this function will call gtk_recent_chooser_set_filter(). Since 2.10

removeFilter
void removeFilter(RecentFilter filter)

Removes filter from the list of GtkRecentFilter objects held by chooser. Since 2.10

listFilters
ListSG listFilters()

Gets the GtkRecentFilter objects held by chooser. Since 2.10

setFilter
void setFilter(RecentFilter filter)

Sets filter as the current GtkRecentFilter object used by chooser to affect the displayed recently used resources. Since 2.10

getFilter
RecentFilter getFilter()

Gets the GtkRecentFilter object currently used by chooser to affect the display of the recently used resources. Since 2.10

Meta