gtkmm  3.4.0
Public Member Functions | Protected Member Functions | Related Functions
Gtk::AppChooserButton Class Reference

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

Inheritance diagram for Gtk::AppChooserButton:
Inheritance graph
[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::AppChooserButtonwrap (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:

appchooserbutton1.png
Since gtkmm 3.0:

Constructor & Destructor Documentation

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_typeThe 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:
nameThe name of the custom item.
labelThe label for the custom item.
iconThe icon for the custom item.

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

Since gtkmm 3.0:

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.
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().

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.

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.

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.

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.

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.

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.

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:
nameThe name of the custom item.

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

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

Parameters:
headingA 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:
settingThe 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:
settingThe new value for Gtk::AppChooserButton::property_show_dialog_item().
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_nameThe 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:
objectThe C instance.
take_copyFalse 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: