[668] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] [patch] Little fix for menu separators

daemon@ATHENA.MIT.EDU (Marcelo Malheiros)
Wed Aug 6 22:27:42 1997

Date: Wed, 6 Aug 1997 23:24:49 -0300
From: Marcelo Malheiros <malheiro@dca.fee.unicamp.br>
To: gtk-list@redhat.com
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

  Hi!

  Here goes a tiny patch to prevent menu separators from getting
keyboard accelerators:

--- gimp-0.99.10/gtk+/gtk/gtkmenu.c.old	Wed Aug  6 03:14:42 1997
+++ gimp-0.99.10/gtk+/gtk/gtkmenu.c	Wed Aug  6 03:36:07 1997
@@ -622,7 +622,7 @@
       menu_shell = GTK_MENU_SHELL (widget);
       menu_item = GTK_MENU_ITEM (menu_shell->active_menu_item);
 
-      if (menu_item)
+      if (menu_item && GTK_BIN (menu_item)->child)
 	{
 	  /* block resizes */
 	  gtk_container_block_resize (GTK_CONTAINER (widget));

  Here is also another patch, now for gimp. It prevents gimp from
installing bogus signal handlers on those separators:

--- gimp-0.99.10/app/menus.c.old	Wed Aug  6 00:13:23 1997
+++ gimp-0.99.10/app/menus.c	Wed Aug  6 02:52:40 1997
@@ -283,7 +283,7 @@
   gtk_menu_factory_add_entries (factory, entries, nmenu_entries);
 
   for (i = 0; i < nmenu_entries; i++)
-    if (entries[i].widget)
+    if (entries[i].widget && GTK_BIN (entries[i].widget)->child)
       {
 	gtk_signal_connect (GTK_OBJECT (entries[i].widget), "install_accelerator",
 			    (GtkSignalFunc) menus_install_accel,

  These were made from a patched 0.99.10 gimp tree, using all of the
Scott Goehring's patches.
  Keep the good work, pals!

    Marcelo

-- 
  Marcelo de Gomensoro Malheiros -- malheiro@dca.fee.unicamp.br
       ---- THE LINUX FILES - The Source Is Out There ----

--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post