Gtk.AppChooserWidget

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.AppChooser Gtk.AppChooser GObject.GInterface->Gtk.AppChooser Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.AppChooserWidget Gtk.AppChooserWidget Gtk.AppChooser->Gtk.AppChooserWidget Gtk.Box Gtk.Box Gtk.Box->Gtk.AppChooserWidget Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.Container->Gtk.Box Gtk.Orientable->Gtk.Box Gtk.Widget->Gtk.Container

Subclasses:

None

Methods

Inherited:

Gtk.Box (14), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2), Gtk.AppChooser (3)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), 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.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

do_application_activated (app_info)

do_application_selected (app_info)

do_populate_popup (menu, app_info)

Properties

Inherited:

Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1), Gtk.AppChooser (1)

Name

Type

Flags

Short Description

default-text

str

r/w/en

The default text appearing when there are no applications

show-all

bool

r/w/c/en

Whether the widget should show all applications

show-default

bool

r/w/c/en

Whether the widget should show the default application

show-fallback

bool

r/w/c/en

Whether the widget should show fallback applications

show-other

bool

r/w/c/en

Whether the widget should show other applications

show-recommended

bool

r/w/c/en

Whether the widget should show recommended applications

Child Properties

Inherited:

Gtk.Box (5)

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gtk.Container (4), Gtk.Widget (69), 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.

populate-popup

Emitted when a context menu is about to popup over an application item.

Fields

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

parent

Gtk.Box

r

Class Details

class Gtk.AppChooserWidget(*args, **kwargs)
Bases:

Gtk.Box, Gtk.AppChooser

Abstract:

No

Structure:

Gtk.AppChooserWidgetClass

Gtk.AppChooserWidget is a widget for selecting applications. It is the main building block for 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.

Gtk.AppChooserWidget offers detailed control over what applications are shown, using the Gtk.AppChooserWidget :show-default, Gtk.AppChooserWidget :show-recommended, Gtk.AppChooserWidget :show-fallback, Gtk.AppChooserWidget :show-other and Gtk.AppChooserWidget :show-all properties. See the Gtk.AppChooser documentation for more information about these groups of applications.

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

CSS nodes

Gtk.AppChooserWidget has a single CSS node with name appchooser.

classmethod new(content_type)[source]
Parameters:

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

Returns:

a newly created Gtk.AppChooserWidget

Return type:

Gtk.Widget

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

New in version 3.0.

get_default_text()[source]
Returns:

the value of Gtk.AppChooserWidget :default-text

Return type:

str

Returns the text that is shown if there are not applications that can handle the content type.

New in version 3.0.

get_show_all()[source]
Returns:

the value of Gtk.AppChooserWidget :show-all

Return type:

bool

Returns the current value of the Gtk.AppChooserWidget :show-all property.

New in version 3.0.

get_show_default()[source]
Returns:

the value of Gtk.AppChooserWidget :show-default

Return type:

bool

Returns the current value of the Gtk.AppChooserWidget :show-default property.

New in version 3.0.

get_show_fallback()[source]
Returns:

the value of Gtk.AppChooserWidget :show-fallback

Return type:

bool

Returns the current value of the Gtk.AppChooserWidget :show-fallback property.

New in version 3.0.

get_show_other()[source]
Returns:

the value of Gtk.AppChooserWidget :show-other

Return type:

bool

Returns the current value of the Gtk.AppChooserWidget :show-other property.

New in version 3.0.

Returns:

the value of Gtk.AppChooserWidget :show-recommended

Return type:

bool

Returns the current value of the Gtk.AppChooserWidget :show-recommended property.

New in version 3.0.

set_default_text(text)[source]
Parameters:

text (str) – the new value for Gtk.AppChooserWidget :default-text

Sets the text that is shown if there are not applications that can handle the content type.

set_show_all(setting)[source]
Parameters:

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

Sets whether the app chooser should show all applications in a flat list.

New in version 3.0.

set_show_default(setting)[source]
Parameters:

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

Sets whether the app chooser should show the default handler for the content type in a separate section.

New in version 3.0.

set_show_fallback(setting)[source]
Parameters:

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

Sets whether the app chooser should show related applications for the content type in a separate section.

New in version 3.0.

set_show_other(setting)[source]
Parameters:

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

Sets whether the app chooser should show applications which are unrelated to the content type.

New in version 3.0.

Parameters:

setting (bool) – the new value for Gtk.AppChooserWidget :show-recommended

Sets whether the app chooser should show recommended applications for the content type in a separate section.

New in version 3.0.

do_application_activated(app_info) virtual
Parameters:

app_info (Gio.AppInfo) –

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

do_application_selected(app_info) virtual
Parameters:

app_info (Gio.AppInfo) –

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

do_populate_popup(menu, app_info) virtual
Parameters:

Signal emitted when a context menu is about to popup over an application item.

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.

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

populate-popup

Flags:

RUN_FIRST

Parameters:

Emitted when a context menu is about to popup over an application item. Clients can insert menu items into the provided Gtk.Menu object in the callback of this signal; the context menu will be shown over the item if at least one item has been added to the menu.

Property Details

Gtk.AppChooserWidget.props.default_text
Name:

default-text

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The Gtk.AppChooserWidget :default-text property determines the text that appears in the widget when there are no applications for the given content type. See also Gtk.AppChooserWidget.set_default_text().

Gtk.AppChooserWidget.props.show_all
Name:

show-all

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT, EXPLICIT_NOTIFY

If the Gtk.AppChooserWidget :show-all property is 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

The ::show-default property 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

The Gtk.AppChooserWidget :show-fallback property 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

The Gtk.AppChooserWidget :show-other property 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

The Gtk.AppChooserWidget :show-recommended property determines whether the app chooser should show a section for recommended applications. If False, the recommended applications are listed among the other applications.