[gtk] widgetbowl: Add switch demo



commit b7f98314a50fad49872a65eaf5468f13ae1a46a6
Author: Timm Bäder <mail baedert org>
Date:   Sat Mar 31 14:54:14 2018 +0200

    widgetbowl: Add switch demo

 demos/gtk-demo/widgetbowl.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/demos/gtk-demo/widgetbowl.c b/demos/gtk-demo/widgetbowl.c
index 4def1b0e25..565c036d6b 100644
--- a/demos/gtk-demo/widgetbowl.c
+++ b/demos/gtk-demo/widgetbowl.c
@@ -103,6 +103,16 @@ create_gears (void)
   return w;
 }
 
+static GtkWidget *
+create_switch (void)
+{
+  GtkWidget *w = gtk_switch_new ();
+
+  gtk_switch_set_state (GTK_SWITCH (w), TRUE);
+
+  return w;
+}
+
 static const struct {
   const char *name;
   GtkWidget * (*create_func) (void);
@@ -116,6 +126,7 @@ static const struct {
   { "Spinbutton", create_spinbutton     },
   { "Video",      create_video          },
   { "Gears",      create_gears          },
+  { "Switch",     create_switch         },
 };
 
 static int selected_widget_type = -1;


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