gtkmm 3.4.0

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Related Functions
Gtk::AppChooserButton Class Reference
Widgets

A button to launch an application chooser dialog. More...

Inheritance diagram for Gtk::AppChooserButton:
[legend]

List of all members.

## Public Member Functions
virtual | ~AppChooserButton ()
GtkAppChooserButton* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkAppChooserButton* | gobj () const
| Provides access to the underlying C GtkObject.
| AppChooserButton (const Glib::ustring& content_type)
| Creates a new app-chooser button for applications that can handle content of the given type.
void | append_separator ()
| Appends a separator to the list of applications that is shown in the popup.
void | append_custom_item (const Glib::ustring& name, const Glib::ustring& label, const Glib::RefPtr< Gio::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.
void | set_active_custom_item (const Glib::ustring& name)
| Selects a custom item previously added with append_custom_item().
void | set_show_dialog_item (bool setting=true)
| Sets whether the dropdown menu of this button should show an entry to trigger a Gtk::AppChooserDialog.
bool | get_show_dialog_item () const
| Returns the current value of the Gtk::AppChooserButton::property_show_dialog_item() property.
void | set_heading (const Glib::ustring& heading)
| Sets the text to display at the top of the dialog.
Glib::ustring | get_heading () const
| Returns the text to display at the top of the dialog.
void | set_show_default_item (bool setting=true)
| Sets whether the dropdown menu of this button should show the default application for the given content type at top.
bool | get_show_default_item () const
| Returns the current value of the Gtk::AppChooserButton::property_show_default_item() property.
Glib::SignalProxy1< void, const Glib::ustring& > | signal_custom_item_activated ()
Glib::PropertyProxy< bool > | property_show_dialog_item ()
| Whether the combobox should include an item that triggers a GtkAppChooserDialog.
Glib::PropertyProxy_ReadOnly < bool > | property_show_dialog_item () const
| Whether the combobox should include an item that triggers a GtkAppChooserDialog.
Glib::PropertyProxy < Glib::ustring > | property_heading ()
| The text to show at the top of the dialog.
Glib::PropertyProxy_ReadOnly < Glib::ustring > | property_heading () const
| The text to show at the top of the dialog.
Glib::PropertyProxy< bool > | property_show_default_item ()
| Whether the combobox should show the default application on top.
Glib::PropertyProxy_ReadOnly < bool > | property_show_default_item () const
| Whether the combobox should show the default application on top.
## Protected Member Functions
virtual void | on_custom_item_activated (const Glib::ustring& item_name)
| This is a default handler for the signal signal_custom_item_activated().
## Related Functions
(Note that these are not member functions.)
Gtk::AppChooserButton* | wrap (GtkAppChooserButton* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

A button to launch an application chooser dialog.

This widget lets the user select an application. See the GtkAppChooser base class API.

The AppChooserButton widget looks like this:

Since gtkmm 3.0:

## Constructor & Destructor Documentation

virtual Gtk::AppChooserButton::~AppChooserButton | ( |  | ) | `[virtual]`

Gtk::AppChooserButton::AppChooserButton | ( | const Glib::ustring & | content_type | ) | `[explicit]`

Creates a new app-chooser button for applications that can handle content of the given type.

Parameters:

  content_type | The content type to show applications for

## Member Function Documentation

void Gtk::AppChooserButton::append_custom_item | ( | const Glib::ustring & | name,
|  | const Glib::ustring & | label,
|  | const Glib::RefPtr< Gio::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 Gtk::AppChooserButton::signal_custom_item_activated() signal, to add a callback for the activation of a particular custom item in the list. See also append_separator().

Since gtkmm 3.0:

Parameters:

  name | The name of the custom item.
  label | The label for the custom item.
  icon | The icon for the custom item.

void Gtk::AppChooserButton::append_separator | ( |  | ) |

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

Since gtkmm 3.0:

Glib::ustring Gtk::AppChooserButton::get_heading | ( |  | ) | const

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

Returns:
  The text to display at the top of the dialog, or `0`, in which case a default text is displayed.

bool Gtk::AppChooserButton::get_show_default_item | ( |  | ) | const

Returns the current value of the Gtk::AppChooserButton::property_show_default_item() property.

Since gtkmm 3.2:

Returns:
  The value of Gtk::AppChooserButton::property_show_default_item().

bool Gtk::AppChooserButton::get_show_dialog_item | ( |  | ) | const

Returns the current value of the Gtk::AppChooserButton::property_show_dialog_item() property.

Since gtkmm 3.0:

Returns:
  The value of Gtk::AppChooserButton::property_show_dialog_item().

GtkAppChooserButton* Gtk::AppChooserButton::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::AppChooser.

const GtkAppChooserButton* Gtk::AppChooserButton::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::AppChooser.

virtual void Gtk::AppChooserButton::on_custom_item_activated | ( | const Glib::ustring & | item_name | ) | `[protected, virtual]`

This is a default handler for the signal signal_custom_item_activated().

Glib::PropertyProxy< Glib::ustring > Gtk::AppChooserButton::property_heading | ( |  | ) |

The text to show at the top of the dialog.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly< Glib::ustring > Gtk::AppChooserButton::property_heading | ( |  | ) | const

The text to show at the top of the dialog.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy< bool > Gtk::AppChooserButton::property_show_default_item | ( |  | ) |

Whether the combobox should show the default application on top.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly< bool > Gtk::AppChooserButton::property_show_default_item | ( |  | ) | const

Whether the combobox should show the default application on top.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy< bool > Gtk::AppChooserButton::property_show_dialog_item | ( |  | ) |

Whether the combobox should include an item that triggers a GtkAppChooserDialog.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly< bool > Gtk::AppChooserButton::property_show_dialog_item | ( |  | ) | const

Whether the combobox should include an item that triggers a GtkAppChooserDialog.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::AppChooserButton::set_active_custom_item | ( | const Glib::ustring & | name | ) |

Selects a custom item previously added with append_custom_item().

Use refresh() to bring the selection to its initial state.

Since gtkmm 3.0:

Parameters:

  name | The name of the custom item.

void Gtk::AppChooserButton::set_heading | ( | const Glib::ustring & | heading | ) |

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

If the heading is not set, the dialog displays a default text.

Parameters:

  heading | A string containing Pango markup.

void Gtk::AppChooserButton::set_show_default_item | ( | bool | setting = `true` | ) |

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

Since gtkmm 3.2:

Parameters:

  setting | The new value for Gtk::AppChooserButton::property_show_default_item().

void Gtk::AppChooserButton::set_show_dialog_item | ( | bool | setting = `true` | ) |

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

Since gtkmm 3.0:

Parameters:

  setting | The new value for Gtk::AppChooserButton::property_show_dialog_item().

Glib::SignalProxy1< void,const Glib::ustring& > Gtk::AppChooserButton::signal_custom_item_activated | ( |  | ) |

Slot Prototype:
  `void on_my_custom_item_activated(const Glib::ustring& item_name)`

Emitted when a custom item, previously added with Gtk::AppChooserButton::append_custom_item(), is activated from the dropdown menu.

Parameters:

  item_name | The name of the activated item.

## Friends And Related Function Documentation

Gtk::AppChooserButton* wrap | ( | GtkAppChooserButton * | object,
|  | bool | take_copy = `false`
| ) |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  object | The C instance.
  take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- gtkmm/appchooserbutton.h