diff options
author | fitzsim <fitzsim@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-22 20:17:43 +0000 |
---|---|---|
committer | fitzsim <fitzsim@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-22 20:17:43 +0000 |
commit | 752df75d28a1141379adf553ea5b1832a24dcace (patch) | |
tree | 19f0d9dacce92d95b8f60e84224aff5193d59507 /libjava/jni | |
parent | acecd7dcb2bfb05164ec5b76bbb0f45ae9a1346b (diff) | |
download | gcc-752df75d28a1141379adf553ea5b1832a24dcace.tar.gz |
2004-01-22 Thomas Fitzsimmons <fitzsim@redhat.com>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
(connectJObject): Replace printf calls with g_assert statements.
Move property-notify-event signal connection to ...
(connectSignals): Connect property-notify-event signal. Iterate
through the vbox's children to find layout.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76367 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/jni')
-rw-r--r-- | libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c index 742550f8ef2..4d808e366bd 100644 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c +++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c @@ -190,11 +190,8 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectJObject children = gtk_container_get_children(GTK_CONTAINER(ptr)); vbox = children->data; + g_assert (GTK_IS_VBOX(vbox)); - if(!GTK_IS_VBOX(vbox)) - { - printf("*** this is not a vbox\n"); - } children = gtk_container_get_children(GTK_CONTAINER(vbox)); do { @@ -202,11 +199,7 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectJObject children = children->next; } while (!GTK_IS_LAYOUT (layout) && children != NULL); - - if(!GTK_IS_LAYOUT(layout)) - { - printf("*** widget is not a layout ***"); - } + g_assert (GTK_IS_LAYOUT(layout)); gtk_widget_realize (layout); @@ -216,9 +209,6 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectJObject connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window); - g_signal_connect (G_OBJECT (ptr), "property-notify-event", - G_CALLBACK (window_property_changed_cb), obj); - gdk_threads_leave (); } @@ -239,10 +229,16 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals /* Receive events from the GtkLayout too */ children = gtk_container_get_children(GTK_CONTAINER(ptr)); vbox = children->data; - g_assert(GTK_IS_VBOX(vbox)); + g_assert (GTK_IS_VBOX (vbox)); + children = gtk_container_get_children(GTK_CONTAINER(vbox)); - layout = children->data; - g_assert(GTK_IS_LAYOUT(layout)); + do + { + layout = children->data; + children = children->next; + } + while (!GTK_IS_LAYOUT (layout) && children != NULL); + g_assert (GTK_IS_LAYOUT (layout)); g_signal_connect (GTK_OBJECT (layout), "event", G_CALLBACK (pre_event_handler), *gref); @@ -266,6 +262,9 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals g_signal_connect (G_OBJECT (ptr), "window-state-event", G_CALLBACK (window_window_state_cb), *gref); + g_signal_connect (G_OBJECT (ptr), "property-notify-event", + G_CALLBACK (window_property_changed_cb), *gref); + gdk_threads_leave (); /* Connect the superclass signals. */ |