summaryrefslogtreecommitdiff
path: root/docs/reference
diff options
context:
space:
mode:
authorMatthias Clasen <maclas@gmx.de>2003-09-30 20:55:24 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2003-09-30 20:55:24 +0000
commit57f13d815ddbdb0d001fa92c823d44744b3577e4 (patch)
tree132e7f9da4eaa9e59fb3443c548db4b714192871 /docs/reference
parent039c6b3bb16343428708ef827a937a7ac64a44a0 (diff)
downloadgtk+-57f13d815ddbdb0d001fa92c823d44744b3577e4.tar.gz
Test handling of empty menus.
2003-09-30 Matthias Clasen <maclas@gmx.de> * tests/merge-*.ui: * tests/testmerge.c: Test handling of empty menus. * gtk/gtkuimanager.c (_gtk_menu_is_empty): New function to determine whether a menu is empty. Used in gtkaction.c. (update_smart_separators): Also update the visibility of empty menus. (update_node): When creating a new menu proxy, insert an "Empty" menu item which only gets shown if the menu is empty. * gtk/gtkaction.c (gtk_action_class_init): Document the meaning of "is_important" for menu proxies. (_gtk_action_sync_menu_visible): New function to sync the visibility of menu proxies. Used in gtkuimanager.c. (gtk_action_sync_visible): New function to sync the visibility of proxies.
Diffstat (limited to 'docs/reference')
-rw-r--r--docs/reference/ChangeLog2
-rw-r--r--docs/reference/gtk/tmpl/gtkuimanager.sgml30
2 files changed, 25 insertions, 7 deletions
diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog
index dbfc1ac38d..68c2d53baf 100644
--- a/docs/reference/ChangeLog
+++ b/docs/reference/ChangeLog
@@ -1,5 +1,7 @@
2003-09-30 Matthias Clasen <maclas@gmx.de>
+ * gtk/tmpl/gtkuimanager.sgml: Add a section about empty menus.
+
* gdk/tmpl/keys.sgml: Small addition.
* gdk/gdk-sections.txt: Add GdkDisplayClass and GdkScreenClass.
diff --git a/docs/reference/gtk/tmpl/gtkuimanager.sgml b/docs/reference/gtk/tmpl/gtkuimanager.sgml
index 6195004350..c2aa340148 100644
--- a/docs/reference/gtk/tmpl/gtkuimanager.sgml
+++ b/docs/reference/gtk/tmpl/gtkuimanager.sgml
@@ -146,15 +146,31 @@ actions even if they have no visible proxies.
<refsect2 id="Smart-Separators">
<title>Smart Separators</title>
<para>
-The separators created by #GtkUIManager are "smart", i.e. they do not show up in the
-UI unless they end up between two visible menu or tool items. Separators which are located
-at the very beginning or end of the menu or toolbar containing them, or multiple separators
-next to each other, are hidden. This is a useful feature, since the merging of UI elements
-from multiple sources can make it hard or impossible to determine in advance whether a
-separator will end up in such an unfortunate position.
+The separators created by #GtkUIManager are "smart", i.e. they do not show up
+in the UI unless they end up between two visible menu or tool items. Separators
+which are located at the very beginning or end of the menu or toolbar
+containing them, or multiple separators next to each other, are hidden. This
+is a useful feature, since the merging of UI elements from multiple sources
+can make it hard or impossible to determine in advance whether a separator
+will end up in such an unfortunate position.
+</para>
+</refsect2>
+<refsect2>
+<title>Empty Menus</title>
+<para>
+Submenus pose similar problems to separators inconnection with merging. It is
+impossible to know in advance whether they will end up empty after merging.
+#GtkUIManager offers two ways to treat empty submenus:
+<itemizedlist>
+<listitem><para>make them disappear by hiding the menu item they're attached to
+</para></listitem>
+<listitem><para>add an insensitive "Empty" item
+</para></listitem>
+</itemizedlist>
+The behaviour is chosen based on the "is_important" property of the action
+to which the submenu is associated.
</para>
</refsect2>
-
<!-- ##### SECTION See_Also ##### -->
<para>