[Java-gnome-developer] client events
Brought to you by:
afcowie
From: Josh H. <jos...@ho...> - 2006-08-10 00:05:21
|
Hello all, I posted here a few weeks ago asking about the java-gnome implementation of the cross-process widgets GtkPlug and GtkSocket. Thank you for the replies. Managed to get Java widgets embedded in a C interface by adding some constructors and glue to Plug and sending the windowIDs through a DatagramSocket; however, I am having troubles modifying this prototype to use the glib client_event/listener scheme built into gtk to handle callbacks. I have gone through the "create a new widget" tutorial and so far I can see three ways to possibly do this: 1. Create a new Widget in Java. An existing widget can be extended and its relative Event class type overridden to recognize a client_event. Unfortunately, I am not aware of any resources for creating a new widget in Java that can send a signal recognized by gtk+ in C. 2. Wrap the gtk+ client_message functions. The function gdk_event_send_client_message was modified to accept int arguments, casted to the correct types, and then wrapped. void java_gdk_event_send_client_message (int event, int winidint) { event = gdk_event_new (event); winid = (GdkNativeWindow)winidint; gdk_event_send_client_message (event, winid); } After calling this wrapped function in Java, the VM throws a segmentation violation in IA__gdk_event_send_client_message_for_display. I suspect this has to do with the default display. Is there a way I should be initializing this? 3. Create a new Widget in C and wrap it. I understand this involves calling the glib functions g_signal_new and g_signal_emit with user defined events; however, I can't seem to create a Java listener to catch the signal. Is there any easier way to handle the communication with these callbacks? Do any of these approaches make sense? Suggestions? Thanks, ~Josh Hope |