diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2010-11-29 16:04:59 +0100 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2010-11-29 16:04:59 +0100 |
commit | 232a5c7b3b4a9bc093f1c68cf9d87e94f47e15ea (patch) | |
tree | 7041b403858b62449ffd5786bb6d786dd22f50f3 /gtk/gtkappchooserbutton.h | |
parent | 8ae7993397816217cfd7b38a7fc3606a2210d64c (diff) | |
download | gtk+-232a5c7b3b4a9bc093f1c68cf9d87e94f47e15ea.tar.gz |
app-chooser-button: change the API approach for custom items
Introduce a 'custom-item-activated' on the widget, which behaves
similairly to GtkEntryCompletion::action-activated, i.e. is emitted when
a custom item is chosen from the dropdown list.
Clients can use the name provided when adding the item as a detail for
the signal, to get notified when that specific item is activated, or use
the signal without details to get notifications for all custom items.
Diffstat (limited to 'gtk/gtkappchooserbutton.h')
-rw-r--r-- | gtk/gtkappchooserbutton.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/gtk/gtkappchooserbutton.h b/gtk/gtkappchooserbutton.h index 743a41ac8c..0ea5416d57 100644 --- a/gtk/gtkappchooserbutton.h +++ b/gtk/gtkappchooserbutton.h @@ -55,23 +55,25 @@ struct _GtkAppChooserButton { struct _GtkAppChooserButtonClass { GtkComboBoxClass parent_class; + void (* custom_item_activated) (GtkAppChooserButton *self, + const gchar *item_name); + /* padding for future class expansion */ gpointer padding[16]; }; GType gtk_app_chooser_button_get_type (void) G_GNUC_CONST; -GtkWidget * gtk_app_chooser_button_new (const gchar *content_type); +GtkWidget * gtk_app_chooser_button_new (const gchar *content_type); -void gtk_app_chooser_button_append_separator (GtkAppChooserButton *self); -void gtk_app_chooser_button_append_custom_item (GtkAppChooserButton *self, - const gchar *label, - GIcon *icon, - GtkAppChooserButtonItemFunc func, - gpointer user_data); +void gtk_app_chooser_button_append_separator (GtkAppChooserButton *self); +void gtk_app_chooser_button_append_custom_item (GtkAppChooserButton *self, + const gchar *name, + const gchar *label, + GIcon *icon); -void gtk_app_chooser_button_set_show_dialog_item (GtkAppChooserButton *self, - gboolean setting); -gboolean gtk_app_chooser_button_get_show_dialog_item (GtkAppChooserButton *self); +void gtk_app_chooser_button_set_show_dialog_item (GtkAppChooserButton *self, + gboolean setting); +gboolean gtk_app_chooser_button_get_show_dialog_item (GtkAppChooserButton *self); #endif /* __GTK_APP_CHOOSER_BUTTON_H__ */ |