Package: gtk

Class gtk:app-chooser-button

Superclasses

Documented Subclasses

None

Direct Slots

heading
The heading property of :string (Read / Write)
The text to show at the top of the dialog that can be opened from the button. The string may contain Pango markup.
Default value: nil
modal
The modal property of :boolean (Read / Write / Construct)
Whether the dialog should be modal.
Default value: true
show-default-item
The show-default-item property of type :boolean (Read / Write / Construct)
Whether the dropdown menu should show the default application on top for the provided content type.
Default value: false
show-dialog-item
The show-dialog-item property of type :boolean (Read / Write / Construct)
Whether the dropdown menu should show an item that triggers a gtk:app-chooser-dialog widget when clicked.
Default value: false

Details

The gtk:app-chooser-button widget is a widget that lets the user select an application. It implements the gtk:app-chooser interface.

Figure: GtkAppChooserButton

Initially, a gtk:app-chooser-button widget selects the first application in its list, which will either be the most-recently used application or, if the show-default-item property is true, the default application.

The list of applications shown in a gtk:app-chooser-button widget includes the recommended applications for the given content type. When the show-default-item property is set, the default application is also included. To let the user chooser other applications, you can set the show-dialog-item property, which allows to open a full gtk:app-chooser-dialog widget.

It is possible to add custom items to the list, using the gtk:app-chooser-button-append-custom-item function. These items cause the "custom-item-activated" signal to be emitted when they are selected.

To track changes in the selected application, use the "changed" signal.

CSS nodes

The gtk:app-chooser-button implementation has a single CSS node with the name appchooserbutton.

Warning

The gtk:app-chooser-button implementation is deprecated since 4.10. The application selection widgets should be implemented according to the design of each platform and/or application requiring them.

Signal Details

The "activate" signal
lambda (button)    :run-first      
button
The gtk:app-chooser-button widget which received the signal.
Emitted to when the button is activated. The signal is an action signal and emitting it causes the button to pop up its dialog.
The "changed" signal
lambda (button)    :run-last      
button
The gtk:app-chooser-button widget which received the signal.
Emitted when the active application on the gtk:app-chooser-button widget changes.
The "custom-item-activated" signal
lambda (button item)    :has-details      
button
The gtk:app-chooser-button widget which received the signal.
item
The string with the name of the activated item.
Emitted when a custom item, previously added with the gtk:app-chooser-button-append-custom-item function, is activated from the dropdown menu.
 

Returned by

Slot Access Functions

Inherited Slot Access Functions

See also

2024-5-21