Gtk.RecentChooser


Gtk.RecentChooser — Interface implemented by widgets displaying recently used files

Object Hierarchy:

    GInterface
    ╰── Gtk.RecentChooser

See also:

Gtk.RecentManager, Gtk.RecentChooserDialog, Gtk.RecentChooserWidget, Gtk.RecentChooserMenu


Functions:


Signals:

  • “item-activated” (chooser, user_data)

Description:

Gtk.RecentChooser is an interface that can be implemented by widgets displaying the list of recently used files.

In GTK+, the main objects that implement this interface are Gtk.RecentChooserWidget,Gtk.RecentChooserDialog and Gtk.RecentChooserMenu.

Recently used files are supported since GTK+ 2.10.


Function Details:

set_show_private()

set_show_private (self, show_private:bool)

Whether to show recently used resources marked registered as private.

  • Since: 2.10

get_show_private()

get_show_private (self) -> bool

Returns whether chooser should display recently used resourcesregistered as private.

  • Returns: True if the recent chooser should show private items,FALSE otherwise.

  • Since: 2.10


set_show_not_found()

set_show_not_found (self, show_not_found:bool)

Sets whether chooser should display the recently used resources thatit didn’t find. This only applies to local resources.

  • Since: 2.10

get_show_not_found()

get_show_not_found (self) -> bool

Retrieves whether chooser should show the recently used resources thatwere not found.

  • Returns: True if the resources not found should be displayed, andFALSE otheriwse.

  • Since: 2.10


set_show_icons()

set_show_icons (self, show_icons:bool)

Sets whether chooser should show an icon near the resource whendisplaying it.

  • Since: 2.10

get_show_icons()

get_show_icons (self) -> bool

Retrieves whether chooser should show an icon near the resource.

  • Returns: True if the icons should be displayed, FALSE otherwise.

  • Since: 2.10


set_select_multiple()

set_select_multiple (self, select_multiple:bool)

Sets whether chooser can select multiple items.

  • Since: 2.10

get_select_multiple()

get_select_multiple (self) -> bool

Gets whether chooser can select multiple items.

  • Returns: True if choosercan select more than one item.

  • Since: 2.10


set_local_only()

set_local_only (self, local_only:bool)

Sets whether only local resources, that is resources using the file:// URIscheme, should be shown in the recently used resources selector. Iflocal_only is True (the default) then the shown resources are guaranteedto be accessible through the operating system native file system.

  • Since: 2.10

get_local_only()

get_local_only (self) -> bool

Gets whether only local resources should be shown in the recently usedresources selector. See Gtk.RecentChooser:set_local_only()

  • Returns: True if only local resources should be shown.

  • Since: 2.10


set_limit()

set_limit (self, limit:int)

Sets the number of items that should be returned byGtk.RecentChooser:get_items() and Gtk.RecentChooser:get_uris().

  • Since: 2.10

get_limit()

get_limit (self) -> int

Gets the number of items returned by Gtk.RecentChooser:get_items()and Gtk.RecentChooser:get_uris().

  • Returns: A positive integer, or -1 meaning that all items arereturned.

  • Since: 2.10


set_show_tips()

set_show_tips (self, show_tips:bool)

Sets whether to show a tooltips containing the full path of eachrecently used resource in a Gtk.RecentChooser widget.

  • Since: 2.10

get_show_tips()

get_show_tips (self) -> bool

Gets whether chooser should display tooltips containing the full pathof a recently user resource.

  • Returns: True if the recent chooser should show tooltips,FALSE otherwise.

  • Since: 2.10


set_sort_type()

set_sort_type (self, sort_type:Gtk.RecentSortType)

Changes the sorting order of the recently used resources list displayed bychooser.

  • Since: 2.10

get_sort_type()

get_sort_type (self) -> Gtk.RecentSortType

Gets the value set by Gtk.RecentChooser:set_sort_type().

  • Returns: the sorting order of the chooser.

  • Since: 2.10


set_sort_func()

set_sort_func (self, sort_func:Gtk.RecentSortFunc, sort_data=None)

Sets the comparison function used when sorting to be sort_func. Ifthe chooser has the sort type set to GTK_RECENT_SORT_CUSTOM thenthe chooser will sort using this function. To the comparison function will be passed two Gtk.RecentInfo structs andsort_data; sort_func should return a positive integer if the firstitem comes before the second, zero if the two items are equal anda negative integer if the first item comes after the second.

  • Since: 2.10

set_current_uri()

set_current_uri (self, uri:str) -> bool

Sets uri as the current URI for chooser.

  • Returns: True if the URI was found.

  • Since: 2.10


get_current_uri()

get_current_uri (self) -> str

Gets the URI currently selected by chooser.

  • Returns: a newly allocated string holding a URI.

  • Since: 2.10


get_current_item()

get_current_item (self) -> Gtk.RecentInfo

Gets the Gtk.RecentInfo currently selected by chooser.

  • Returns: a Gtk.RecentInfo. Use `Gtk.RecentInfo:unref()` whenwhen you have finished using it.

  • Since: 2.10


select_uri()

select_uri (self, uri:str) -> bool

Selects uri inside chooser.

  • Returns: True if uriwas found.

  • Since: 2.10


unselect_uri()

unselect_uri (self, uri:str)

Unselects uri inside chooser.

  • Since: 2.10

select_all()

select_all (self)

Selects all the items inside chooser, if the chooser supportsmultiple selection.

  • Since: 2.10

unselect_all()

unselect_all (self)

Unselects all the items inside chooser.

  • Since: 2.10

get_items()

get_items (self) -> list

Gets the list of recently used resources in form of Gtk.RecentInfo objects. The return value of this function is affected by the “sort-type” and“limit” properties of chooser.

  • Returns: A newly allocatedlist of Gtk.RecentInfo objects. You shoulduse `Gtk.RecentInfo:unref()on every item of the list, and then freethe list itself usingg_list_free()`.

  • Since: 2.10


get_uris()

get_uris (self) -> list, length:int

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 None terminated, length may be None.

  • Returns: A newly allocated, None-terminated array of strings. Useg_strfreev() to free it.

  • Since: 2.10


add_filter()

add_filter (self, filter:Gtk.RecentFilter)

Adds filter to the list of Gtk.RecentFilter objects held by chooser. If no previous filter objects were defined, this function will callGtk.RecentChooser:set_filter().

  • Since: 2.10

remove_filter()

remove_filter (self, filter:Gtk.RecentFilter)

Removes filter from the list of Gtk.RecentFilter objects held by chooser.

  • Since: 2.10

list_filters()

list_filters (self) -> list

Gets the Gtk.RecentFilter objects held by chooser.

  • Returns: A singly linked listof Gtk.RecentFilter objects. Youshould just free the returned list using g_slist_free().

  • Since: 2.10


set_filter()

set_filter (self, filter:Gtk.RecentFilter=None)

Sets filter as the current Gtk.RecentFilter object used by chooserto affect the displayed recently used resources.

  • Since: 2.10

get_filter()

get_filter (self) -> Gtk.RecentFilter

Gets the Gtk.RecentFilter object currently used by chooser to affectthe display of the recently used resources.

  • Returns: a Gtk.RecentFilter object.

  • Since: 2.10


results matching ""

    No results matching ""