2004-01-29 Kim Ho <kho@redhat.com>

* gnu/java/awt/peer/gtk/GtkFramePeer.java
        (gtkLayoutSetVisible): New method
        (setMenuBar): Hide layout before setting MenuBar
        and reshow it after.
        * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
        (gtkLayoutSetVisible): Hide or show the Gtk Layout.

From-SVN: r76861
This commit is contained in:
Kim Ho 2004-01-29 14:34:31 +00:00 committed by Kim Ho
parent 6d23f07f2b
commit 5efa76401e
3 changed files with 45 additions and 0 deletions

View file

@ -60,6 +60,7 @@ public class GtkFramePeer extends GtkWindowPeer
native void setMenuBarPeer (MenuBarPeer bar);
native void removeMenuBarPeer ();
native void moveLayout (int offset);
native void gtkLayoutSetVisible (boolean vis);
public void setMenuBar (MenuBar bar)
{
@ -67,16 +68,19 @@ public class GtkFramePeer extends GtkWindowPeer
{
if (menuBar != null)
{
gtkLayoutSetVisible(false);
removeMenuBarPeer();
menuBar = null;
moveLayout(menuBarHeight);
insets.top -= menuBarHeight;
menuBarHeight = 0;
awtComponent.doLayout();
gtkLayoutSetVisible(true);
}
}
else
{
gtkLayoutSetVisible(false);
int oldHeight = 0;
if (menuBar != null)
{
@ -91,6 +95,7 @@ public class GtkFramePeer extends GtkWindowPeer
moveLayout(oldHeight - menuBarHeight);
insets.top += menuBarHeight;
awtComponent.doLayout();
gtkLayoutSetVisible(true);
}
}