Hi,

The following patch cleans up the last awt Menu related bits. It is
mainly a documentation of the gtk+ peer infrastructure and a few tweaks
to make the parent MenuContainer always responsible for the MenuItems it
contains. This finally makes my MenuMenu testcase and the hsqldb
DatabaseManager recent commands menu work without any warnings or
errors.

2006-02-15  Mark Wielaard  <[EMAIL PROTECTED]>

    * java/awt/Menu.java (add(MenuItem)): Use item.getParent() to get
    parent field.
    (insert): Likewise.
    (addNotify): Add the item after addNotifying it.
    * java/awt/MenuBar.java (setHelpMenu): Only call removeNotify() when
    there is a peer. Use getParent() and setParent() to manipulate parent
    field.
    (add(Menu)): Use getParent() and setParent() to manipulate parent
    field. Call addNotify() and addMenu() when there is a peer.
    (remove(int)): Call removeNotify() and delMenu() when there is a peer.
    (addNotify): Use getPeer()/setPeer(). Call addMenu() and addHelpMenu()
    when there is a peer.
    * gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java (create): Document.
    (GtkMenuComponentPeer): Document. Take MenuComponent as argument.
    (setFont): Call setFont(Font).
    (setFont(Font)): Document. Only set font when not null.
    * gnu/java/awt/peer/gtk/GtkMenuItemPeer.java (create): Document. Made
    protected.
    (connectSignals): Likewise.
    (GtkMenuItemPeer): Document. Don't try to add item. Always call
    connectSignals().
    * gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java (create): Make
    protected.
    (postMenuActionEvent): Document.
    * gnu/java/awt/peer/gtk/GtkMenuPeer.java (create): Document. Made
    protected.
    (addItem): Document. Made private.
    (addTearOff): Made private.
    (connectSignals): New protected overridden method.
    (GtkMenuPeer): Correctly cast setupAccelGroup() arguments.
    * gnu/java/awt/peer/gtk/GtkMenuBarPeer.java (hasHelpMenu): New field.
    (create): Document.
    (addMenu): Made private, take GtkMenuPeer as argument and document.
    (GtkMenuBarPeer): Document.
    (nativeSetHelpMenu): Removed.
    (addHelpMenu): Implement.
    (delMenu): Document.
    (addMenu): Implement.
    * gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java (setParent): Removed.
    * include/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h: Regenerated.
    * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
    (Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_nativeSetHelpMenu):
    Removed.

Does this look good?

Also tested with the vte (although that doesn't contain many menu
related tests. It could probably need another cleanup round. Especially
for the PopupMenu stuff. I have to admit that I don't completely get how
Popups are supposed to work. But the vte test still works as expected.

Cheers,

Mark
Index: gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java,v
retrieving revision 1.9
diff -u -r1.9 GtkCheckboxMenuItemPeer.java
--- gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java	2 Jul 2005 20:32:12 -0000	1.9
+++ gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java	15 Feb 2006 23:55:17 -0000
@@ -1,5 +1,5 @@
 /* GtkCheckboxMenuItemPeer.java -- Implements CheckboxMenuItemPeer with GTK+
-   Copyright (C) 1999, 2005  Free Software Foundation, Inc.
+   Copyright (C) 1999, 2005, 2006  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -46,7 +46,7 @@
 public class GtkCheckboxMenuItemPeer extends GtkMenuItemPeer
   implements CheckboxMenuItemPeer
 {
-  native void create (String label);
+  protected native void create (String label);
 
   public GtkCheckboxMenuItemPeer (CheckboxMenuItem menu)
   {
@@ -56,6 +56,11 @@
 
   public native void setState(boolean t);
 
+  /**
+   * Called from the signal handler of the gtk widget.  Posts a
+   * ItemEvent to indicate a state changed, then calls super to post
+   * an ActionEvent.
+   */
   protected void postMenuActionEvent ()
   {
     CheckboxMenuItem item = (CheckboxMenuItem)awtWidget;
Index: gnu/java/awt/peer/gtk/GtkMenuBarPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java,v
retrieving revision 1.12
diff -u -r1.12 GtkMenuBarPeer.java
--- gnu/java/awt/peer/gtk/GtkMenuBarPeer.java	13 Feb 2006 18:57:03 -0000	1.12
+++ gnu/java/awt/peer/gtk/GtkMenuBarPeer.java	15 Feb 2006 23:55:17 -0000
@@ -48,29 +48,69 @@
 public class GtkMenuBarPeer extends GtkMenuComponentPeer
   implements MenuBarPeer
 {
+  /** Whether we already have an help menu set on this peer. */
+  private boolean hasHelpMenu;
 
-  protected native void create ();
-  native void addMenu (MenuPeer menu);
-
-  public GtkMenuBarPeer (MenuBar target)
+  /**
+   * Creates the gtk+ widget for this peer and puts it in the nsa
+   * table. Called from the (super class) constructor.
+   */
+  protected native void create();
+
+  /**
+   * Adds a new GtkMenuPeer to the end of the GtkMenuBarPeer.
+   */
+  private native void addMenu(GtkMenuPeer menu);
+
+  /**
+   * Creates a new GtkMenuBarPeer associated with the given MenuBar.
+   */
+  public GtkMenuBarPeer(MenuBar menubar)
   {
-    super (target);
+    super(menubar);
   }
 
-  // FIXME: remove this method or replace it with one that does
-  // something useful.
-  /* In Gnome, help menus are no longer right flushed. */
-  native void nativeSetHelpMenu(MenuPeer menuPeer);
-
+  /**
+   * Adds a help menu to this MenuBar. Gnome styleguides say the help
+   * menu is just the last item in the menubar (they are NOT right
+   * justified).
+   */
   public void addHelpMenu (Menu menu)
   {
-    // nativeSetHelpMenu((MenuPeer) menu.getPeer());
+    if (hasHelpMenu)
+      {
+	// Remove the (help) menu, which is after all the other items.
+	delMenu(((MenuBar) awtWidget).getMenuCount());
+	hasHelpMenu = false;
+      }
+
+    if (menu != null)
+      {
+	addMenu(menu);
+	hasHelpMenu = true;
+      }
   }
 
+  /**
+   * Deletes the menu at (zero-based) index from this GtkMenuBar.
+   */
   public native void delMenu(int index);
 
-  public void addMenu (Menu m)
+  /**
+   * Adds the GtkMenuPeer associated with the Menu to this
+   * GtkMenuBarPeer. Makes sure that any help menus keep the last menu
+   * on the bar.
+   */
+  public void addMenu(Menu m)
   {
-    // FIXME: implement
+    // Make sure the help menu is the last one.
+    if (hasHelpMenu)
+      {
+	addHelpMenu(null);
+	addMenu((GtkMenuPeer) m.getPeer());
+	addHelpMenu(((MenuBar) awtWidget).getHelpMenu());
+      }
+    else
+      addMenu((GtkMenuPeer) m.getPeer());
   }
 }
Index: gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java,v
retrieving revision 1.12
diff -u -r1.12 GtkMenuComponentPeer.java
--- gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java	13 Feb 2006 18:57:03 -0000	1.12
+++ gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java	15 Feb 2006 23:55:17 -0000
@@ -46,6 +46,10 @@
 public abstract class GtkMenuComponentPeer extends GtkGenericPeer
   implements MenuComponentPeer
 {
+  /**
+   * Creates the associated gtk+ widget and stores it in the nsa table
+   * for this peer. Called by the constructor.
+   */
   protected abstract void create ();
 
   /**
@@ -55,7 +59,7 @@
   private void setFont()
   {
     MenuComponent mc = ((MenuComponent) awtWidget);
-    Font f = mc.getFont ();
+    Font f = mc.getFont();
     
     if (f == null)
       {
@@ -64,17 +68,21 @@
 	if (parent instanceof MenuComponent)
 	  f = parent.getFont ();
       }
-    if (f != null)
-      {
-	gtkWidgetModifyFont(f);
-      }
+
+    setFont(f);
   }
 
-  public GtkMenuComponentPeer (Object awtWidget)
+  /**
+   * Will call the abstract <code>create()</code> that needs to be
+   * overridden by subclasses, to create the MenuComponent. It will
+   * then correctly setup the font for the component based on the
+   * component and/or its containing parent component.
+   */
+  public GtkMenuComponentPeer(MenuComponent component)
   {
-    super (awtWidget);
-    create ();
-    setFont ();
+    super(component);
+    create();
+    setFont();
   }
 
   /**
@@ -84,8 +92,13 @@
    */
   public native void dispose();
 
+  /**
+   * Sets the font for this particular MenuComponent only (not any
+   * containing items, if any).
+   */
   public void setFont(Font font)
   {
-    gtkWidgetModifyFont(font);
+    if (font != null)
+      gtkWidgetModifyFont(font);
   }
 }
Index: gnu/java/awt/peer/gtk/GtkMenuItemPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java,v
retrieving revision 1.17
diff -u -r1.17 GtkMenuItemPeer.java
--- gnu/java/awt/peer/gtk/GtkMenuItemPeer.java	13 Feb 2006 18:57:03 -0000	1.17
+++ gnu/java/awt/peer/gtk/GtkMenuItemPeer.java	15 Feb 2006 23:55:17 -0000
@@ -49,59 +49,71 @@
 public class GtkMenuItemPeer extends GtkMenuComponentPeer
   implements MenuItemPeer
 {
-  native void create (String label);
-  native void connectSignals ();
+  /**
+   * Creates the associated gtk+ widget and stores it in the nsa table
+   * for this peer. Called by the create() method with the label name
+   * of the associated MenuItem. Needs to be overridden my subclasses
+   * that want to create a different gtk+ widget.
+   */
+  protected native void create (String label);
+
+  /**
+   * Called from constructor to enable signals from an item. If a
+   * subclass needs different (or no) signals connected this method
+   * should be overridden.
+   */
+  protected native void connectSignals ();
 
   /**
    * Overridden to set font on menu item label.
    */
   protected native void gtkWidgetModifyFont(String name, int style, int size);
 
+  /**
+   * Creates the associated gtk+ widget and stores it in the nsa table
+   * for this peer. Called by the (super class) constructor.
+   * Overridden to get the label if the assiociated MenuItem and to
+   * call create(String).
+   */
   protected void create()
   {
     create (((MenuItem) awtWidget).getLabel());
   }
 
-  public GtkMenuItemPeer (MenuItem item)
-  {
-    super (item);
-    setEnabled (item.isEnabled ());
-    setParent (item);
-
-    if (item.getParent() instanceof Menu && ! (item instanceof Menu))
-      connectSignals();
-  }
-
-  void setParent (MenuItem item)
+  /**
+   * Creates a new GtkMenuItemPeer associated with the given MenuItem.
+   * It will call create(), setFont(), setEnabled() and
+   * connectSignals() in that order.
+   */
+  public GtkMenuItemPeer(MenuItem item)
   {
-    // add ourself differently, based on what type of parent we have
-    // yes, the typecasting here is nasty.
-    Object parent = item.getParent ();
-    if (parent instanceof MenuBar)
-      {
-	((GtkMenuBarPeer)((MenuBar)parent).getPeer ()).addMenu ((MenuPeer) this);
-      }
-    else // parent instanceof Menu
-      {
-	((GtkMenuPeer)((Menu)parent).getPeer ()).addItem (this, 
-							  item.getShortcut ());
-      }
+    super(item);
+    setEnabled (item.isEnabled());
+    connectSignals();
   }
 
-  public void disable ()
+  /**
+   * Calls setEnabled(false).
+   */
+  public void disable()
   {
-    setEnabled (false);
+    setEnabled(false);
   }
 
-  public void enable ()
+  /**
+   * Calls setEnabled(true).
+   */
+  public void enable()
   {
-    setEnabled (true);
+    setEnabled(true);
   }
 
   public native void setEnabled(boolean b);
-
   public native void setLabel(String label);
 
+  /**
+   * Callback setup through connectSignals().
+   */
   protected void postMenuActionEvent ()
   {
     postActionEvent (((MenuItem)awtWidget).getActionCommand (), 0);
Index: gnu/java/awt/peer/gtk/GtkMenuPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkMenuPeer.java,v
retrieving revision 1.11
diff -u -r1.11 GtkMenuPeer.java
--- gnu/java/awt/peer/gtk/GtkMenuPeer.java	13 Aug 2005 00:34:31 -0000	1.11
+++ gnu/java/awt/peer/gtk/GtkMenuPeer.java	15 Feb 2006 23:55:17 -0000
@@ -1,5 +1,5 @@
 /* GtkMenuPeer.java -- Implements MenuPeer with GTK+
-   Copyright (C) 1999, 2005  Free Software Foundation, Inc.
+   Copyright (C) 1999, 2005, 2006  Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -49,10 +49,28 @@
 public class GtkMenuPeer extends GtkMenuItemPeer
   implements MenuPeer
 {
-  native void create (String label);
-  native void addItem (MenuItemPeer item, int key, boolean shiftModifier);
+  /**
+   * Creates the associated gtk+ widget and stores it in the nsa table
+   * for this peer. Called by the create() method with the label name
+   * of the associated MenuItem. Overridden to greate a Menu widget.
+   */
+  protected native void create (String label);
+
+  private native void addItem(MenuItemPeer item, int key,
+			      boolean shiftModifier);
+
+  /** XXX - Document this and the override in GtkPopupMenuPeer. */
   native void setupAccelGroup (GtkGenericPeer container);
-  native void addTearOff ();
+
+  private native void addTearOff ();
+
+  /**
+   * Overridden to not connect any signals.
+   */
+  protected void connectSignals()
+  {
+    // No signals to connect.
+  }
 
   public GtkMenuPeer (Menu menu)
   {
@@ -63,11 +81,11 @@
 
     MenuContainer parent = menu.getParent ();
     if (parent instanceof Menu)
-      setupAccelGroup ((GtkGenericPeer)((Menu)parent).getPeer ());
+      setupAccelGroup ((GtkMenuPeer)((Menu)parent).getPeer ());
     else if (parent instanceof Component)
-      setupAccelGroup ((GtkGenericPeer)((Component)parent).getPeer ());
+      setupAccelGroup ((GtkComponentPeer)((Component)parent).getPeer ());
     else
-      setupAccelGroup (null);
+      setupAccelGroup (null); // XXX, should we warn about unknown parent?
   }
 
   public void addItem (MenuItem item)
Index: gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java
===================================================================
RCS file: /cvsroot/classpath/classpath/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java,v
retrieving revision 1.9
diff -u -r1.9 GtkPopupMenuPeer.java
--- gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java	2 Jul 2005 20:32:12 -0000	1.9
+++ gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java	15 Feb 2006 23:55:17 -0000
@@ -1,5 +1,5 @@
 /* GtkPopupMenuPeer.java -- Implements PopupMenuPeer with GTK+
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -55,11 +55,6 @@
 
   native void setupAccelGroup (GtkGenericPeer container);
 
-  void setParent (MenuItem item)
-  {
-    // we don't need to "add" ourselves to our parent
-  }
-
   native void show (int x, int y, long time);
   public void show (Component origin, int x, int y)
   {
Index: include/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h
===================================================================
RCS file: /cvsroot/classpath/classpath/include/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h,v
retrieving revision 1.5
diff -u -r1.5 gnu_java_awt_peer_gtk_GtkMenuBarPeer.h
--- include/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h	23 Sep 2004 22:57:12 -0000	1.5
+++ include/gnu_java_awt_peer_gtk_GtkMenuBarPeer.h	15 Feb 2006 23:55:17 -0000
@@ -12,7 +12,6 @@
 
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create (JNIEnv *env, jobject);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_addMenu (JNIEnv *env, jobject, jobject);
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_nativeSetHelpMenu (JNIEnv *env, jobject, jobject);
 JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_delMenu (JNIEnv *env, jobject, jint);
 
 #ifdef __cplusplus
Index: java/awt/Menu.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Menu.java,v
retrieving revision 1.22
diff -u -r1.22 Menu.java
--- java/awt/Menu.java	14 Feb 2006 21:22:14 -0000	1.22
+++ java/awt/Menu.java	15 Feb 2006 23:55:18 -0000
@@ -220,8 +220,9 @@
 public MenuItem
 add(MenuItem item)
 {
-  if (item.parent != null)
-    item.parent.remove(item);
+  MenuContainer parent = item.getParent();
+  if (parent != null)
+    parent.remove(item);
 
   items.addElement(item);
   item.setParent(this);
@@ -272,8 +273,9 @@
     add(item);
   else
     {
-      if (item.parent != null)
-	item.parent.remove(item);
+      MenuContainer parent = item.getParent();
+      if (parent != null)
+	parent.remove(item);
       
       items.insertElementAt(item, index);
       item.setParent(this);
@@ -403,14 +405,21 @@
 public void
 addNotify()
 {
+  MenuPeer peer = (MenuPeer) getPeer();
   if (peer == null)
-    peer = getToolkit().createMenu(this);
+    {
+      peer = getToolkit().createMenu(this);
+      setPeer(peer);
+    }
+
   Enumeration e = items.elements();
   while (e.hasMoreElements())
   {
     MenuItem mi = (MenuItem)e.nextElement();
     mi.addNotify();
-  }    
+    peer.addItem(mi);
+  }
+
   super.addNotify ();
 }
 
Index: java/awt/MenuBar.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/MenuBar.java,v
retrieving revision 1.21
diff -u -r1.21 MenuBar.java
--- java/awt/MenuBar.java	14 Feb 2006 16:26:19 -0000	1.21
+++ java/awt/MenuBar.java	15 Feb 2006 23:55:18 -0000
@@ -101,18 +101,21 @@
    */
   public synchronized void setHelpMenu(Menu menu)
   {
+    MenuBarPeer myPeer = (MenuBarPeer) getPeer ();
+
     if (helpMenu != null)
       {
-        helpMenu.removeNotify();
-        helpMenu.parent = null;
+	if (myPeer != null)
+	  helpMenu.removeNotify();
+        helpMenu.setParent(null);
       }
     helpMenu = menu;
 
-    if (menu.parent != null)
-      menu.parent.remove(menu);
-    menu.parent = this;
+    MenuContainer parent = menu.getParent();
+    if (parent != null)
+      parent.remove(menu);
+    menu.setParent(this);
 
-    MenuBarPeer myPeer = (MenuBarPeer) getPeer ();
     if (myPeer != null)
       {
         menu.addNotify();
@@ -131,15 +134,20 @@
    */
   public synchronized Menu add(Menu menu)
   {
-    if (menu.parent != null)
-      menu.parent.remove(menu);
+    MenuBarPeer myPeer = (MenuBarPeer) getPeer ();
 
-    menu.parent = this;
-    menus.addElement(menu);
+    MenuContainer parent = menu.getParent();
+    if (parent != null)
+      parent.remove(menu);
 
-    if (peer != null)
-      menu.addNotify();
+    menus.addElement(menu);
+    menu.setParent(this);
 
+    if (myPeer != null)
+      {
+        menu.addNotify();
+        myPeer.addMenu(menu);
+      }
     return menu;
   }
 
@@ -150,16 +158,16 @@
    */
   public synchronized void remove(int index)
   {
-    Menu m = (Menu) menus.get(index);
-    menus.remove(index);
-    m.removeNotify();
-    m.parent = null;
+    Menu m = (Menu) menus.remove(index);
+    MenuBarPeer mp = (MenuBarPeer) getPeer();
 
-    if (peer != null)
-      {
-        MenuBarPeer mp = (MenuBarPeer) peer;
-        mp.delMenu(index);
-      }
+    if (mp != null)
+      m.removeNotify();
+
+    m.setParent(null);
+
+    if (mp != null)
+      mp.delMenu(index);
   }
 
   /**
@@ -218,18 +226,25 @@
    */
   public void addNotify()
   {
-    if (getPeer() == null)
-      setPeer(getToolkit().createMenuBar(this));
+    MenuBarPeer peer = (MenuBarPeer) getPeer();
+    if (peer == null)
+      {
+	peer = getToolkit().createMenuBar(this);
+	setPeer(peer);
+      }
+
     Enumeration e = menus.elements();
     while (e.hasMoreElements())
       {
         Menu mi = (Menu)e.nextElement();
         mi.addNotify();
+	peer.addMenu(mi);
       }
+
     if (helpMenu != null)
       {
         helpMenu.addNotify();
-        ((MenuBarPeer) peer).addHelpMenu(helpMenu);
+        peer.addHelpMenu(helpMenu);
       }
   }
 
Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c,v
retrieving revision 1.13
diff -u -r1.13 gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c	22 Sep 2005 20:25:39 -0000	1.13
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c	15 Feb 2006 23:55:18 -0000
@@ -1,5 +1,5 @@
 /* gtkmenubarpeer.c -- Native implementation of GtkMenuBarPeer
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2006 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -74,32 +74,6 @@
 }
 
 JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_nativeSetHelpMenu
-  (JNIEnv *env, jobject obj, jobject menupeer)
-{
-  static void *helpmenu;
-  void *mbar, *menu;
-  GList *list;
-
-  gdk_threads_enter ();
-
-  mbar = NSA_GET_PTR (env, obj);
-  menu = NSA_GET_PTR (env, menupeer);
-
-  if (helpmenu != NULL)
-    {
-      list = gtk_container_get_children (GTK_CONTAINER (mbar));
-      while (list != NULL && list->data != helpmenu)
-        list = list->next;
-      if (list != NULL && list->data == helpmenu)
-        gtk_container_remove (GTK_CONTAINER (mbar), GTK_WIDGET (list->data));
-    }
-  helpmenu = menu;
-
-  gdk_threads_leave ();
-}
-
-JNIEXPORT void JNICALL
 Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_delMenu
   (JNIEnv *env, jobject obj, jint index)
 {

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to