gtk.app_chooser_button

Module for [AppChooserButton] class

Types 3

The #GtkAppChooserButton is a widget that lets the user select an application. It implements the #GtkAppChooser interface.

Initially, a #GtkAppChooserButton selects the first application in its list, which will either be the most-recently used application or, if #GtkAppChooserButton:show-default-item is true, the default application.

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

It is possible to add custom items to the list, using [gtk.app_chooser_button.AppChooserButton.appendCustomItem]. These items cause the #GtkAppChooserButton::custom-item-activated signal to be emitted when they are selected.

To track changes in the selected application, use the #GtkComboBox::changed signal.

Methods
GType _gType() @property
AppChooserButton self()Returns `this`, for use in `with` statements.
AppChooserButtonGidBuilder builder()Get builder for [gtk.appchooserbutton.AppChooserButton] Returns: New builder object
string heading() @propertyGet `heading` property. Returns: The text to show at the top of the dialog that can be opened from the button. The string may contain Pango markup.
void heading(string propval) @propertySet `heading` property. Params: propval = The text to show at the top of the dialog that can be opened from the button. The string may contain Pango markup.
bool showDefaultItem() @propertyGet `showDefaultItem` property. Returns: The #GtkAppChooserButton:show-default-item property determines whether the dropdown menu should show the default application on top for the provided content...
void showDefaultItem(bool propval) @propertySet `showDefaultItem` property. Params: propval = The #GtkAppChooserButton:show-default-item property determines whether the dropdown menu should show the default application on top for the provide...
bool showDialogItem() @propertyGet `showDialogItem` property. Returns: The #GtkAppChooserButton:show-dialog-item property determines whether the dropdown menu should show an item that triggers a #GtkAppChooserDialog when clicked.
void showDialogItem(bool propval) @propertySet `showDialogItem` property. Params: propval = The #GtkAppChooserButton:show-dialog-item property determines whether the dropdown menu should show an item that triggers a #GtkAppChooserDialog whe...
void appendCustomItem(string name, string label, gio.icon.Icon icon)Appends a custom item to the list of applications that is shown in the popup; the item name must be unique per-widget. Clients can use the provided name as a detail for the #GtkAppChooserButton::cu...
void appendSeparator()Appends a separator to the list of applications that is shown in the popup.
string getHeading()Returns the text to display at the top of the dialog. Returns: the text to display at the top of the dialog, or null, in which case a default text is displayed
bool getShowDefaultItem()Returns the current value of the #GtkAppChooserButton:show-default-item property. Returns: the value of #GtkAppChooserButton:show-default-item
bool getShowDialogItem()Returns the current value of the #GtkAppChooserButton:show-dialog-item property. Returns: the value of #GtkAppChooserButton:show-dialog-item
void setActiveCustomItem(string name)Selects a custom item previously added with [gtk.appchooserbutton.AppChooserButton.appendCustomItem].
void setHeading(string heading)Sets the text to display at the top of the dialog. If the heading is not set, the dialog displays a default text.
void setShowDefaultItem(bool setting)Sets whether the dropdown menu of this button should show the default application for the given content type at top.
void setShowDialogItem(bool setting)Sets whether the dropdown menu of this button should show an entry to trigger a #GtkAppChooserDialog.
gulong connectCustomItemActivated(T)(string detail = null, T callback, Flag!"After" after = No.After) if (isCallable!T && is(ReturnType!T == void) && (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == string))) && (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.app_chooser_button.AppChooserButton))) && Parameters!T.length < 3)Connect to `CustomItemActivated` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this(string contentType)Creates a new #GtkAppChooserButton for applications that can handle content of the given type.
Methods
T heading(string propval)Set `heading` property. Params: propval = The text to show at the top of the dialog that can be opened from the button. The string may contain Pango markup. Returns: Builder instance for fluent cha...
T showDefaultItem(bool propval)Set `showDefaultItem` property. Params: propval = The #GtkAppChooserButton:show-default-item property determines whether the dropdown menu should show the default application on top for the provide...
T showDialogItem(bool propval)Set `showDialogItem` property. Params: propval = The #GtkAppChooserButton:show-dialog-item property determines whether the dropdown menu should show an item that triggers a #GtkAppChooserDialog whe...

Fluent builder for [gtk.app_chooser_button.AppChooserButton]