+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.
+
2004-01-28 Michael Koch <konqueror@gmx.de>
* gnu/java/lang/ClassHelper.java
native void setMenuBarPeer (MenuBarPeer bar);
native void removeMenuBarPeer ();
native void moveLayout (int offset);
+ native void gtkLayoutSetVisible (boolean vis);
public void setMenuBar (MenuBar bar)
{
{
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)
{
moveLayout(oldHeight - menuBarHeight);
insets.top += menuBarHeight;
awtComponent.doLayout();
+ gtkLayoutSetVisible(true);
}
}
gdk_threads_leave ();
}
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkFramePeer_gtkLayoutSetVisible
+ (JNIEnv *env, jobject obj, jboolean vis)
+{
+ void* ptr;
+ GList* children;
+ GtkBox* vbox;
+ GtkLayout* layout;
+
+ ptr = NSA_GET_PTR (env, obj);
+
+ gdk_threads_enter ();
+
+ children = gtk_container_get_children (GTK_CONTAINER (ptr));
+ vbox = children->data;
+ g_assert (GTK_IS_VBOX (vbox));
+ children = gtk_container_get_children (GTK_CONTAINER (vbox));
+ do
+ {
+ layout = children->data;
+ children = children->next;
+ }
+ while (!GTK_IS_LAYOUT (layout) && children != NULL);
+ g_assert (GTK_IS_LAYOUT (layout));
+
+ if (vis)
+ gtk_widget_show (GTK_WIDGET (layout));
+ else
+ gtk_widget_hide (GTK_WIDGET (layout));
+ gdk_threads_leave ();
+}
static void
window_get_frame_extents (GtkWidget *window,
int *top, int *left, int *bottom, int *right)