[gtk] fishbowl: Add a menubutton demo



commit 63f6aca1cf33572867ab5f8cd73bfeaed83e4244
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri May 24 00:31:07 2019 +0000

    fishbowl: Add a menubutton demo
    
    This reveals some issues with the position tracking.

 demos/gtk-demo/fishbowl.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
---
diff --git a/demos/gtk-demo/fishbowl.c b/demos/gtk-demo/fishbowl.c
index d2f0c399a7..6a1ad923a0 100644
--- a/demos/gtk-demo/fishbowl.c
+++ b/demos/gtk-demo/fishbowl.c
@@ -164,6 +164,19 @@ create_switch (void)
   return w;
 }
 
+static GtkWidget *
+create_menu_button (void)
+{
+  GtkWidget *w = gtk_menu_button_new ();
+  GtkWidget *popover = gtk_popover_new (NULL);
+
+  gtk_container_add (GTK_CONTAINER (popover), gtk_button_new_with_label ("Hey!"));
+  gtk_menu_button_set_popover (GTK_MENU_BUTTON (w), popover);
+  gtk_menu_button_popup (GTK_MENU_BUTTON (w));
+
+  return w;
+}
+
 static const struct {
   const char *name;
   GtkWidget * (*create_func) (void);
@@ -179,6 +192,7 @@ static const struct {
   { "Video",      create_video          },
   { "Gears",      create_gears          },
   { "Switch",     create_switch         },
+  { "Menubutton", create_menu_button    },
 };
 
 static int selected_widget_type = -1;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]