gtk.app_chooser_button

Module for [AppChooserButton] class

Types 3

The gtk.app_chooser_button.AppChooserButton lets the user select an application.

!An example GtkAppChooserButton

Initially, a gtk.app_chooser_button.AppChooserButton selects the first application in its list, which will either be the most-recently used application or, if gtk.app_chooser_button.AppChooserButton.showDefaultItem is true, the default application.

The list of applications shown in a gtk.app_chooser_button.AppChooserButton includes the recommended applications for the given content type. When gtk.app_chooser_button.AppChooserButton.showDefaultItem is set, the default application is also included. To let the user chooser other applications, you can set the gtk.app_chooser_button.AppChooserButton.showDialogItem property, which allows to open a full gtk.app_chooser_dialog.AppChooserDialog.

It is possible to add custom items to the list, using gtk.app_chooser_button.AppChooserButton.appendCustomItem. These items cause the gtk.app_chooser_button.AppChooserButton.customItemActivated signal to be emitted when they are selected.

To track changes in the selected application, use the gtk.app_chooser_button.AppChooserButton.changed signal.

CSS nodes

gtk.app_chooser_button.AppChooserButton has a single CSS node with the name “appchooserbutton”.

Deprecated

The application selection widgets should be

implemented according to the design of each platform and/or application requiring them.

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
AppChooserButton self() nothrowReturns `this`, for use in `with` statements.
AppChooserButtonGidBuilder builder() static nothrowGet builder for [gtk.app_chooser_button.AppChooserButton] Returns: New builder object
string heading() @property nothrowGet `heading` property. Returns: The text to show at the top of the dialog that can be opened from the button.
void heading(string propval) @property nothrowSet `heading` property. Params: propval = The text to show at the top of the dialog that can be opened from the button.
bool modal() @property nothrowGet `modal` property. Returns: Whether the app chooser dialog should be modal.
void modal(bool propval) @property nothrowSet `modal` property. Params: propval = Whether the app chooser dialog should be modal.
bool showDefaultItem() @property nothrowGet `showDefaultItem` property. Returns: Determines whether the dropdown menu shows the default application on top for the provided content type.
void showDefaultItem(bool propval) @property nothrowSet `showDefaultItem` property. Params: propval = Determines whether the dropdown menu shows the default application on top for the provided content type.
bool showDialogItem() @property nothrowGet `showDialogItem` property. Returns: Determines whether the dropdown menu shows an item to open a [gtk.app_chooser_dialog.AppChooserDialog].
void showDialogItem(bool propval) @property nothrowSet `showDialogItem` property. Params: propval = Determines whether the dropdown menu shows an item to open a [gtk.app_chooser_dialog.AppChooserDialog].
void appendCustomItem(string name, string label, gio.icon.Icon icon) nothrowAppends a custom item to the list of applications that is shown in the popup.
void appendSeparator() nothrowAppends a separator to the list of applications that is shown in the popup.
string getHeading() nothrowReturns 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 getModal() nothrowGets whether the dialog is modal. Returns: true if the dialog is modal
bool getShowDefaultItem() nothrowReturns whether the dropdown menu should show the default application at the top. Returns: the value of [gtk.app_chooser_button.AppChooserButton.showDefaultItem]
bool getShowDialogItem() nothrowReturns whether the dropdown menu shows an item for a [gtk.app_chooser_dialog.AppChooserDialog]. Returns: the value of [gtk.app_chooser_button.AppChooserButton.showDialogItem]
void setActiveCustomItem(string name) nothrowSelects a custom item.
void setHeading(string heading) nothrowSets the text to display at the top of the dialog.
void setModal(bool modal) nothrowSets whether the dialog should be modal.
void setShowDefaultItem(bool setting) nothrowSets whether the dropdown menu of this button should show the default application for the given content type at top.
void setShowDialogItem(bool setting) nothrowSets whether the dropdown menu of this button should show an entry to trigger a [gtk.app_chooser_dialog.AppChooserDialog].
gulong connectActivate(T)(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] : gtk.app_chooser_button.AppChooserButton))) && Parameters!T.length < 2) nothrowConnect to `Activate` signal.
gulong connectChanged(T)(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] : gtk.app_chooser_button.AppChooserButton))) && Parameters!T.length < 2) nothrowConnect to `Changed` signal.
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) nothrowConnect to `CustomItemActivated` signal.
Constructors
this(void * ptr, Flag!"Take" take)
this(string contentType)Creates a new [gtk.app_chooser_button.AppChooserButton] for applications that can handle content of the given type.

Fluent builder implementation template for gtk.app_chooser_button.AppChooserButton

Methods
T heading(string propval) nothrowSet `heading` property. Params: propval = The text to show at the top of the dialog that can be opened from the button.
T modal(bool propval) nothrowSet `modal` property. Params: propval = Whether the app chooser dialog should be modal. Returns: Builder instance for fluent chaining
T showDefaultItem(bool propval) nothrowSet `showDefaultItem` property. Params: propval = Determines whether the dropdown menu shows the default application on top for the provided content type. Returns: Builder instance for fluent chaining
T showDialogItem(bool propval) nothrowSet `showDialogItem` property. Params: propval = Determines whether the dropdown menu shows an item to open a [gtk.app_chooser_dialog.AppChooserDialog]. Returns: Builder instance for fluent chaining