AppChooserButton

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

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

The list of applications shown in a gtk.AppChooserButton includes the recommended applications for the given content type. When show-default-item 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.AppChooserDialog

It is possible to add custom items to the list, using AppChooserButton.appendCustomItem. 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.

Constructors

this
this(GtkAppChooserButton* gtkAppChooserButton, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string contentType)

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

Members

Functions

addOnCustomItemActivated
gulong addOnCustomItemActivated(void delegate(string, AppChooserButton) dlg, ConnectFlags connectFlags)

Emitted when a custom item, previously added with AppChooserButton.appendCustomItem, is activated from the dropdown menu.

appendCustomItem
void appendCustomItem(string name, string label, IconIF 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 custom-item-activated signal, to add a callback for the activation of a particular custom item in the list. See also AppChooserButton.appendSeparator.

appendSeparator
void appendSeparator()

Appends a separator to the list of applications that is shown in the popup.

getAppChooserButtonStruct
GtkAppChooserButton* getAppChooserButtonStruct(bool transferOwnership)

Get the main Gtk struct

getHeading
string getHeading()

Returns the text to display at the top of the dialog.

getShowDefaultItem
bool getShowDefaultItem()

Returns the current value of the show-default-item property.

getShowDialogItem
bool getShowDialogItem()

Returns the current value of the show-dialog-item property.

getStruct
void* getStruct()

the main Gtk struct as a void*

setActiveCustomItem
void setActiveCustomItem(string name)

Selects a custom item previously added with AppChooserButton.appendCustomItem.

setHeading
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.

setShowDefaultItem
void setShowDefaultItem(bool setting)

Sets whether the dropdown menu of this button should show the default application for the given content type at top.

setShowDialogItem
void setShowDialogItem(bool setting)

Sets whether the dropdown menu of this button should show an entry to trigger a gtk.AppChooserDialog

Static functions

getType
GType getType()

Variables

gtkAppChooserButton
GtkAppChooserButton* gtkAppChooserButton;

the main Gtk struct

Inherited Members

From ComboBox

gtkComboBox
GtkComboBox* gtkComboBox;

the main Gtk struct

getComboBoxStruct
GtkComboBox* getComboBoxStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
getActive
int getActive()

Returns the index of the currently active item, or -1 if there’s no active item. If the model is a non-flat treemodel, and the active item is not an immediate child of the root of the tree, this function returns gtk_tree_path_get_indices (path)[0], where path is the gtk.TreePath of the active item.

getActiveId
string getActiveId()

Returns the ID of the active row of combo_box. This value is taken from the active row and the column specified by the id-column property of combo_box (see ComboBox.setIdColumn).

getActiveIter
bool getActiveIter(TreeIter iter)

Sets iter to point to the currently active item, if any item is active. Otherwise, iter is left unchanged.

getAddTearoffs
bool getAddTearoffs()

Gets the current value of the :add-tearoffs property.

getButtonSensitivity
GtkSensitivityType getButtonSensitivity()

Returns whether the combo box sets the dropdown button sensitive or not when there are no items in the model.

getColumnSpanColumn
int getColumnSpanColumn()

Returns the column with column span information for combo_box.

getEntryTextColumn
int getEntryTextColumn()

Returns the column which combo_box is using to get the strings from to display in the internal entry.

getFocusOnClick
bool getFocusOnClick()

Returns whether the combo box grabs focus when it is clicked with the mouse. See ComboBox.setFocusOnClick.

getHasEntry
bool getHasEntry()

Returns whether the combo box has an entry.

getIdColumn
int getIdColumn()

Returns the column which combo_box is using to get string IDs for values from.

getModel
TreeModelIF getModel()

Returns the gtk.TreeModel which is acting as data source for combo_box.

getPopupAccessible
ObjectAtk getPopupAccessible()

Gets the accessible object corresponding to the combo box’s popup.

getPopupFixedWidth
bool getPopupFixedWidth()

Gets whether the popup uses a fixed width matching the allocated width of the combo box.

getRowSeparatorFunc
GtkTreeViewRowSeparatorFunc getRowSeparatorFunc()

Returns the current row separator function.

getRowSpanColumn
int getRowSpanColumn()

Returns the column with row span information for combo_box.

getTitle
string getTitle()

Gets the current title of the menu in tearoff mode. See ComboBox.setAddTearoffs.

getWrapWidth
int getWrapWidth()

Returns the wrap width which is used to determine the number of columns for the popup menu. If the wrap width is larger than 1, the combo box is in table mode.

popdown
void popdown()

Hides the menu or dropdown list of combo_box.

popup
void popup()

Pops up the menu or dropdown list of combo_box.

popupForDevice
void popupForDevice(Device device)

Pops up the menu or dropdown list of combo_box, the popup window will be grabbed so only device and its associated pointer/keyboard are the only gdk.Devices able to send events to it.

setActive
void setActive(int index)

Sets the active item of combo_box to be the item at index.

setActiveId
bool setActiveId(string activeId)

Changes the active row of combo_box to the one that has an ID equal to active_id, or unsets the active row if active_id is NULL. Rows having a NULL ID string cannot be made active by this function.

setActiveIter
void setActiveIter(TreeIter iter)

Sets the current active item to be the one referenced by iter, or unsets the active item if iter is NULL.

setAddTearoffs
void setAddTearoffs(bool addTearoffs)

Sets whether the popup menu should have a tearoff menu item.

setButtonSensitivity
void setButtonSensitivity(GtkSensitivityType sensitivity)

Sets whether the dropdown button of the combo box should be always sensitive (GTK_SENSITIVITY_ON), never sensitive (GTK_SENSITIVITY_OFF) or only if there is at least one item to display (GTK_SENSITIVITY_AUTO).

setColumnSpanColumn
void setColumnSpanColumn(int columnSpan)

Sets the column with column span information for combo_box to be column_span. The column span column contains integers which indicate how many columns an item should span.

setEntryTextColumn
void setEntryTextColumn(int textColumn)

Sets the model column which combo_box should use to get strings from to be text_column. The column text_column in the model of combo_box must be of type G_TYPE_STRING.

setFocusOnClick
void setFocusOnClick(bool focusOnClick)

Sets whether the combo box will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.

setIdColumn
void setIdColumn(int idColumn)

Sets the model column which combo_box should use to get string IDs for values from. The column id_column in the model of combo_box must be of type G_TYPE_STRING.

setModel
void setModel(TreeModelIF model)

Sets the model used by combo_box to be model. Will unset a previously set model (if applicable). If model is NULL, then it will unset the model.

setPopupFixedWidth
void setPopupFixedWidth(bool fixed)

Specifies whether the popup’s width should be a fixed width matching the allocated width of the combo box.

setRowSeparatorFunc
void setRowSeparatorFunc(GtkTreeViewRowSeparatorFunc func, void* data, GDestroyNotify destroy)

Sets the row separator function, which is used to determine whether a row should be drawn as a separator. If the row separator function is NULL, no separators are drawn. This is the default value.

setRowSpanColumn
void setRowSpanColumn(int rowSpan)

Sets the column with row span information for combo_box to be row_span. The row span column contains integers which indicate how many rows an item should span.

setTitle
void setTitle(string title)

Sets the menu’s title in tearoff mode.

setWrapWidth
void setWrapWidth(int width)

Sets the wrap width of combo_box to be width. The wrap width is basically the preferred number of columns when you want the popup to be layed out in a table.

addOnChanged
gulong addOnChanged(void delegate(ComboBox) dlg, ConnectFlags connectFlags)

The changed signal is emitted when the active item is changed. The can be due to the user selecting a different item from the list, or due to a call to ComboBox.setActiveIter. It will also be emitted while typing into the entry of a combo box with an entry.

addOnFormatEntryText
gulong addOnFormatEntryText(string delegate(string, ComboBox) dlg, ConnectFlags connectFlags)

For combo boxes that are created with an entry (See GtkComboBox:has-entry).

addOnMoveActive
gulong addOnMoveActive(void delegate(GtkScrollType, ComboBox) dlg, ConnectFlags connectFlags)

The ::move-active signal is a [keybinding signal]GtkBindingSignal which gets emitted to move the active selection.

addOnPopdown
gulong addOnPopdown(bool delegate(ComboBox) dlg, ConnectFlags connectFlags)

The ::popdown signal is a [keybinding signal]GtkBindingSignal which gets emitted to popdown the combo box list.

addOnPopup
gulong addOnPopup(void delegate(ComboBox) dlg, ConnectFlags connectFlags)

The ::popup signal is a [keybinding signal]GtkBindingSignal which gets emitted to popup the combo box list.

From AppChooserIF

getAppChooserStruct
GtkAppChooser* getAppChooserStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
getAppInfo
AppInfoIF getAppInfo()

Returns the currently selected application.

getContentType
string getContentType()

Returns the current value of the content-type property.

refresh
void refresh()

Reloads the list of applications.