AppChooserWidget
Deprecated since version 4.10: The application selection widgets should be implemented according to the design of each platform and/or application requiring them.
Superclasses: Widget
, InitiallyUnowned
, Object
Implemented Interfaces: Accessible
, AppChooser
, Buildable
, ConstraintTarget
GtkAppChooserWidget
is a widget for selecting applications.
It is the main building block for AppChooserDialog
.
Most applications only need to use the latter; but you can use
this widget as part of a larger widget if you have special needs.
GtkAppChooserWidget
offers detailed control over what applications
are shown, using the
show_default
,
show_recommended
,
show_fallback
,
show_other
and
show_all
properties. See the
AppChooser
documentation for more information about these
groups of applications.
To keep track of the selected application, use the
application_selected
and
application_activated
signals.
CSS nodes
GtkAppChooserWidget
has a single CSS node with name appchooser.
Constructors
Methods
- class AppChooserWidget
- get_default_text() str | None
Returns the text that is shown if there are not applications that can handle the content type.
Deprecated since version 4.10: This widget will be removed in GTK 5
- get_show_all() bool
Gets whether the app chooser should show all applications in a flat list.
Deprecated since version 4.10: This widget will be removed in GTK 5
- get_show_default() bool
Gets whether the app chooser should show the default handler for the content type in a separate section.
Deprecated since version 4.10: This widget will be removed in GTK 5
- get_show_fallback() bool
Gets whether the app chooser should show related applications for the content type in a separate section.
Deprecated since version 4.10: This widget will be removed in GTK 5
- get_show_other() bool
Gets whether the app chooser should show applications which are unrelated to the content type.
Deprecated since version 4.10: This widget will be removed in GTK 5
- get_show_recommended() bool
Gets whether the app chooser should show recommended applications for the content type in a separate section.
Deprecated since version 4.10: This widget will be removed in GTK 5
- set_default_text(text: str) None
Sets the text that is shown if there are not applications that can handle the content type.
Deprecated since version 4.10: This widget will be removed in GTK 5
- Parameters:
text – the new value for
default_text
- set_show_all(setting: bool) None
Sets whether the app chooser should show all applications in a flat list.
Deprecated since version 4.10: This widget will be removed in GTK 5
- Parameters:
setting – the new value for
show_all
- set_show_default(setting: bool) None
Sets whether the app chooser should show the default handler for the content type in a separate section.
Deprecated since version 4.10: This widget will be removed in GTK 5
- Parameters:
setting – the new value for
show_default
- set_show_fallback(setting: bool) None
Sets whether the app chooser should show related applications for the content type in a separate section.
Deprecated since version 4.10: This widget will be removed in GTK 5
- Parameters:
setting – the new value for
show_fallback
- set_show_other(setting: bool) None
Sets whether the app chooser should show applications which are unrelated to the content type.
Deprecated since version 4.10: This widget will be removed in GTK 5
- Parameters:
setting – the new value for
show_other
- set_show_recommended(setting: bool) None
Sets whether the app chooser should show recommended applications for the content type in a separate section.
Deprecated since version 4.10: This widget will be removed in GTK 5
- Parameters:
setting – the new value for
show_recommended
Properties
- class AppChooserWidget
- props.default_text: str
The text that appears in the widget when there are no applications for the given content type.
- props.show_all: bool
If
True
, the app chooser presents all applications in a single list, without subsections for default, recommended or related applications.
- props.show_default: bool
Determines whether the app chooser should show the default handler for the content type in a separate section.
If
False
, the default handler is listed among the recommended applications.
- props.show_fallback: bool
Determines whether the app chooser should show a section for fallback applications.
If
False
, the fallback applications are listed among the other applications.
Signals
- class AppChooserWidget.signals
- application_activated(application: AppInfo) None
Emitted when an application item is activated from the widget’s list.
This usually happens when the user double clicks an item, or an item is selected and the user presses one of the keys Space, Shift+Space, Return or Enter.
- Parameters:
application – the activated
GAppInfo