summaryrefslogtreecommitdiff
path: root/gtk/gtkmenubutton.h
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2019-08-22 09:06:43 +0200
committerTimm Bäder <mail@baedert.org>2019-09-09 17:36:23 +0200
commitc0214cfcc1d1e005793f96019ef56becd67bab26 (patch)
treedb2a46904b4d10b5bb18ac344b864a446d64dce3 /gtk/gtkmenubutton.h
parentcb6d96d65fd11ecf57d58575f5e8e0f30d1b9f2d (diff)
downloadgtk+-c0214cfcc1d1e005793f96019ef56becd67bab26.tar.gz
menubutton: Add a create_popup_func
Some use cases require a menu button to create the popup on demand.
Diffstat (limited to 'gtk/gtkmenubutton.h')
-rw-r--r--gtk/gtkmenubutton.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk/gtkmenubutton.h b/gtk/gtkmenubutton.h
index ad97d2b4fe..4ec73d39ff 100644
--- a/gtk/gtkmenubutton.h
+++ b/gtk/gtkmenubutton.h
@@ -37,6 +37,18 @@ G_BEGIN_DECLS
typedef struct _GtkMenuButton GtkMenuButton;
+/**
+ * GtkMenuButtonCreatePopupFunc:
+ * @menu_button: the #GtkMenuButton
+ *
+ * User-provided callback function to create a popup for @menu_button on demand.
+ * This function is called when the popoup of @menu_button is shown, but none has
+ * been provided via gtk_menu_buton_set_popup(), gtk_menu_button_set_popover()
+ * or gtk_menu_button_set_menu_model().
+ */
+typedef void (*GtkMenuButtonCreatePopupFunc) (GtkMenuButton *menu_button,
+ gpointer user_data);
+
GDK_AVAILABLE_IN_ALL
GType gtk_menu_button_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
@@ -102,6 +114,11 @@ void gtk_menu_button_popup (GtkMenuButton *menu_button);
GDK_AVAILABLE_IN_ALL
void gtk_menu_button_popdown (GtkMenuButton *menu_button);
+GDK_AVAILABLE_IN_ALL
+void gtk_menu_button_set_create_popup_func (GtkMenuButton *menu_button,
+ GtkMenuButtonCreatePopupFunc func,
+ gpointer user_data,
+ GDestroyNotify destroy_notify);
G_END_DECLS