summaryrefslogtreecommitdiff
path: root/native
diff options
context:
space:
mode:
authorKim Ho <kho@redhat.com>2004-01-29 14:51:50 +0000
committerKim Ho <kho@redhat.com>2004-01-29 14:51:50 +0000
commit8473ffe4149c35ead81d48b39552da85e56f2d32 (patch)
tree50755f5f08af0c7cd8c5dd192500bf8de8527a06 /native
parent76b90c2fb2ecd6a991cd1916eaa273c397249811 (diff)
downloadclasspath-8473ffe4149c35ead81d48b39552da85e56f2d32.tar.gz
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. * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c (gtkLayoutSetVisible): Hide or show the Gtk Layout. * include/gnu_java_awt_peer_gtk_GtkFramePeer.h: Regenerated.
Diffstat (limited to 'native')
-rw-r--r--native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
index 7fe567db7..082f29930 100644
--- a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+++ b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
@@ -492,7 +492,38 @@ Java_gnu_java_awt_peer_gtk_GtkFramePeer_moveLayout
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)