Gtk.AppChooserWidget

g GObject.GInterface GObject.GInterface Gtk.Accessible Gtk.Accessible GObject.GInterface->Gtk.Accessible Gtk.AppChooser Gtk.AppChooser GObject.GInterface->Gtk.AppChooser Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.ConstraintTarget Gtk.ConstraintTarget GObject.GInterface->Gtk.ConstraintTarget GObject.InitiallyUnowned GObject.InitiallyUnowned Gtk.Widget Gtk.Widget GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Accessible->Gtk.Widget Gtk.AppChooserWidget Gtk.AppChooserWidget Gtk.AppChooser->Gtk.AppChooserWidget Gtk.Buildable->Gtk.Widget Gtk.ConstraintTarget->Gtk.Widget Gtk.Widget->Gtk.AppChooserWidget

Subclasses:

None

Methods

Inherited:

Gtk.Widget (181), GObject.Object (37), Gtk.Accessible (15), Gtk.Buildable (1), Gtk.AppChooser (3)

Structs:

Gtk.WidgetClass (18), GObject.ObjectClass (5)

class

new (content_type)

get_default_text ()

get_show_all ()

get_show_default ()

get_show_fallback ()

get_show_other ()

get_show_recommended ()

set_default_text (text)

set_show_all (setting)

set_show_default (setting)

set_show_fallback (setting)

set_show_other (setting)

set_show_recommended (setting)

Virtual Methods

Inherited:

Gtk.Widget (25), GObject.Object (7), Gtk.Accessible (6), Gtk.Buildable (9)

Properties

Inherited:

Gtk.Widget (34), Gtk.Accessible (1), Gtk.AppChooser (1)

Name

Type

Flags

Short Description

default-text

str

r/w/en

show-all

bool

r/w/c/en

show-default

bool

r/w/c/en

show-fallback

bool

r/w/c/en

show-other

bool

r/w/c/en

show-recommended

bool

r/w/c/en

Signals

Inherited:

Gtk.Widget (13), GObject.Object (1)

Name

Short Description

application-activated

Emitted when an application item is activated from the widget’s list.

application-selected

Emitted when an application item is selected from the widget’s list.

Fields

Inherited:

Gtk.Widget (13), GObject.Object (1)

Class Details

class Gtk.AppChooserWidget(**kwargs)
Bases:

Gtk.Widget, Gtk.AppChooser

Abstract:

No

GtkAppChooserWidget is a widget for selecting applications.

It is the main building block for [class`Gtk`.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 [property`Gtk`.AppChooserWidget:show-default], [property`Gtk`.AppChooserWidget:show-recommended], [property`Gtk`.AppChooserWidget:show-fallback], [property`Gtk`.AppChooserWidget:show-other] and [property`Gtk`.AppChooserWidget:show-all] properties. See the [iface`Gtk`.AppChooser] documentation for more information about these groups of applications.

To keep track of the selected application, use the [signal`Gtk`.AppChooserWidget::application-selected] and [signal`Gtk`.AppChooserWidget::application-activated] signals.

CSS nodes

GtkAppChooserWidget has a single CSS node with name appchooser.

Deprecated since version 4.10: The application selection widgets should be implemented according to the design of each platform and/or application requiring them.

classmethod new(content_type)[source]
Parameters:

content_type (str) – the content type to show applications for

Returns:

a newly created GtkAppChooserWidget

Return type:

Gtk.Widget

Creates a new GtkAppChooserWidget for applications that can handle content of the given type.

Deprecated since version 4.10: This widget will be removed in GTK 5

get_default_text()[source]
Returns:

the value of [property`Gtk`.AppChooserWidget:default-text]

Return type:

str or 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()[source]
Returns:

the value of [property`Gtk`.AppChooserWidget:show-all]

Return type:

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()[source]
Returns:

the value of [property`Gtk`.AppChooserWidget:show-default]

Return type:

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()[source]
Returns:

the value of [property`Gtk`.AppChooserWidget:show-fallback]

Return type:

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()[source]
Returns:

the value of [property`Gtk`.AppChooserWidget:show-other]

Return type:

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

Returns:

the value of [property`Gtk`.AppChooserWidget:show-recommended]

Return type:

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)[source]
Parameters:

text (str) – the new value for [property`Gtk`.AppChooserWidget:default-text]

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

set_show_all(setting)[source]
Parameters:

setting (bool) – the new value for [property`Gtk`.AppChooserWidget:show-all]

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

set_show_default(setting)[source]
Parameters:

setting (bool) – the new value for [property`Gtk`.AppChooserWidget:show-default]

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

set_show_fallback(setting)[source]
Parameters:

setting (bool) – the new value for [property`Gtk`.AppChooserWidget:show-fallback]

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

set_show_other(setting)[source]
Parameters:

setting (bool) – the new value for [property`Gtk`.AppChooserWidget:show-other]

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 (bool) – the new value for [property`Gtk`.AppChooserWidget:show-recommended]

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

Signal Details

Gtk.AppChooserWidget.signals.application_activated(app_chooser_widget, application)
Signal Name:

application-activated

Flags:

RUN_FIRST

Parameters:

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.

Gtk.AppChooserWidget.signals.application_selected(app_chooser_widget, application)
Signal Name:

application-selected

Flags:

RUN_FIRST

Parameters:

Emitted when an application item is selected from the widget’s list.

Property Details

Gtk.AppChooserWidget.props.default_text
Name:

default-text

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The text that appears in the widget when there are no applications for the given content type.

Gtk.AppChooserWidget.props.show_all
Name:

show-all

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

If True, the app chooser presents all applications in a single list, without subsections for default, recommended or related applications.

Gtk.AppChooserWidget.props.show_default
Name:

show-default

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

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.

Gtk.AppChooserWidget.props.show_fallback
Name:

show-fallback

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

Determines whether the app chooser should show a section for fallback applications.

If False, the fallback applications are listed among the other applications.

Gtk.AppChooserWidget.props.show_other
Name:

show-other

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

Determines whether the app chooser should show a section for other applications.

Name:

show-recommended

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

Determines whether the app chooser should show a section for recommended applications.

If False, the recommended applications are listed among the other applications.