This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: small GtkWindowPeer fixes


Hi,

I committed the following as obvious.

Tom

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.

Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
===================================================================
RCS file:
/cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c,v
retrieving revision 1.19
diff -u -r1.19 gnu_java_awt_peer_gtk_GtkWindowPeer.c
--- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c	22 Jan 2004
09:54:19 -0000	1.19
+++ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c	22 Jan 2004
20:10:53 -0000
@@ -190,11 +190,8 @@
 
   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 @@
     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 @@
 
   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 @@
   /* 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);
@@ -265,6 +261,9 @@
 
   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 ();
 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]