diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2004-01-22 20:17:43 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@gcc.gnu.org> | 2004-01-22 20:17:43 +0000 |
commit | 9deab0b79fe10afd8cd889414b87e594cef9c50b (patch) | |
tree | 19f0d9dacce92d95b8f60e84224aff5193d59507 /libjava/jni | |
parent | 398b3debc46060c500086e7566caf8ce2b23e1d0 (diff) | |
download | gcc-9deab0b79fe10afd8cd889414b87e594cef9c50b.zip gcc-9deab0b79fe10afd8cd889414b87e594cef9c50b.tar.gz gcc-9deab0b79fe10afd8cd889414b87e594cef9c50b.tar.bz2 |
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.
From-SVN: r76367
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 742550f..4d808e3 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. */ |