summaryrefslogtreecommitdiff
path: root/demos/gtk-demo/menus.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2001-04-18 18:09:18 +0000
committerHavoc Pennington <hp@src.gnome.org>2001-04-18 18:09:18 +0000
commit60b6a010e931aaaf97d723c893068381a421f0a0 (patch)
tree14982e448c4281c77bdfb5cd17add1a61fe72fce /demos/gtk-demo/menus.c
parentebd3958c0641d82b54f26118155e4669725900e2 (diff)
downloadgtk+-60b6a010e931aaaf97d723c893068381a421f0a0.tar.gz
fix to properly queue resizes when the image is set
2001-04-18 Havoc Pennington <hp@redhat.com> * gtk/gtkimage.c: fix to properly queue resizes when the image is set * gtk/gtktextview.c (gtk_text_view_do_popup): desensitize Paste if the insertion point isn't editable * demos/gtk-demo/images.c: Added a GtkImage demo * demos/gtk-demo/drawingarea.c: drawing area demo * demos/gtk-demo/menus.c (create_menu): cleanups 2001-04-18 Havoc Pennington <hp@redhat.com> * gdk-pixbuf.c (gdk_pixbuf_fill): Function to fill pixbuf with a given color.
Diffstat (limited to 'demos/gtk-demo/menus.c')
-rw-r--r--demos/gtk-demo/menus.c34
1 files changed, 27 insertions, 7 deletions
diff --git a/demos/gtk-demo/menus.c b/demos/gtk-demo/menus.c
index ac8a7e2c53..4788edd861 100644
--- a/demos/gtk-demo/menus.c
+++ b/demos/gtk-demo/menus.c
@@ -1,10 +1,31 @@
/* Menus
*
- * GTK+ includes a number of widgets for menus of actions.
- * GtkMenu is a drop-down menu, GtkMenuBar a horizontal menu bar.
- * Each of these widgets can hold various types of menuitem.
- * As well as the base type, GtkMenuItem, there are GtkCheckMenuItem,
- * GtkRadioMenuItem and GtkTearoffMenuItem.
+ * There are several widgets involved in displaying menus. The
+ * GtkMenuBar widget is a horizontal menu bar, which normally appears
+ * at the top of an application. The GtkMenu widget is the actual menu
+ * that pops up. Both GtkMenuBar and GtkMenu are subclasses of
+ * GtkMenuShell; a GtkMenuShell contains menu items
+ * (GtkMenuItem). Each menu item contains text and/or images and can
+ * be selected by the user.
+ *
+ * There are several kinds of menu item, including plain GtkMenuItem,
+ * GtkCheckMenuItem which can be checked/unchecked, GtkRadioMenuItem
+ * which is a check menu item that's in a mutually exclusive group,
+ * GtkSeparatorMenuItem which is a separator bar, GtkTearoffMenuItem
+ * which allows a GtkMenu to be torn off, and GtkImageMenuItem which
+ * can place a GtkImage or other widget next to the menu text.
+ *
+ * A GtkMenuItem can have a submenu, which is simply a GtkMenu to pop
+ * up when the menu item is selected. Typically, all menu items in a menu bar
+ * have submenus.
+ *
+ * The GtkOptionMenu widget is a button that pops up a GtkMenu when clicked.
+ * It's used inside dialogs and such.
+ *
+ * GtkItemFactory provides a higher-level interface for creating menu bars
+ * and menus; while you can construct menus manually, most people don't
+ * do that. There's a separate demo for GtkItemFactory.
+ *
*/
#include <stdio.h>
@@ -39,8 +60,7 @@ create_menu (gint depth, gboolean tearoff)
sprintf (buf, "item %2d - %d", depth, j);
menuitem = gtk_radio_menu_item_new_with_label (group, buf);
group = gtk_radio_menu_item_group (GTK_RADIO_MENU_ITEM (menuitem));
- if (depth % 2)
- gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (menuitem), TRUE);
+
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
gtk_widget_show (menuitem);
if (i == 3)