Commit 99aa90b0 authored by Matthias Clasen's avatar Matthias Clasen

Add GtkSwitch to the widget gallery

parent 0ca07a6d
......@@ -322,7 +322,8 @@ HTML_IMAGES = \
$(srcdir)/images/layout-tblr.png \
$(srcdir)/images/layout-tbrl.png \
$(srcdir)/images/window-default.png \
$(srcdir)/images/hello-world.png
$(srcdir)/images/hello-world.png \
$(srcdir)/images/switch.png
# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS=--extra-dir=../gdk/html \
......
......@@ -123,4 +123,7 @@
<link linkend="GtkFileChooserDialog">
<inlinegraphic fileref="filechooser.png" format="PNG"></inlinegraphic>
</link>
<link linkend="GtkSwitch">
<inlinegraphic fileref="switch.png" format="PNG"></inlinegraphic>
</link>
</para>
......@@ -115,6 +115,7 @@ new_widget_info (const char *name,
else
{
info->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_has_resize_grip (GTK_WINDOW (info->window), FALSE);
info->include_decorations = FALSE;
gtk_widget_show_all (widget);
gtk_container_add (GTK_CONTAINER (info->window), widget);
......@@ -159,6 +160,26 @@ create_button (void)
return new_widget_info ("button", align, SMALL);
}
static WidgetInfo *
create_switch (void)
{
GtkWidget *widget;
GtkWidget *align;
GtkWidget *sw;
widget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3);
sw = gtk_switch_new ();
gtk_switch_set_active (GTK_SWITCH (sw), TRUE);
gtk_box_pack_start (GTK_BOX (widget), sw, TRUE, TRUE, 0);
sw = gtk_switch_new ();
gtk_box_pack_start (GTK_BOX (widget), sw, TRUE, TRUE, 0);
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
gtk_container_add (GTK_CONTAINER (align), widget);
return new_widget_info ("switch", align, SMALL);
}
static WidgetInfo *
create_toggle_button (void)
{
......@@ -1095,6 +1116,7 @@ get_all_widgets (void)
retval = g_list_prepend (retval, create_page_setup_dialog ());
retval = g_list_prepend (retval, create_print_dialog ());
retval = g_list_prepend (retval, create_volume_button ());
retval = g_list_prepend (retval, create_switch ());
return retval;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment