[Glade-users] Window communication.

jbrite jbrite@webdsi.com
Fri, 17 Aug 2001 14:33:00 -0500


I'm kind of new, but I've had a good amount of success in getting the widgets 
to work (so far).  If no one else offers help, make a sample for me to look 
at and I'll see if I can get it to work.

-Jeff


On Thursday 16 August 2001 15:16, James Campbell wrote:
> Hello,
>
> I'm running into an interesting problem that I thought was covered
> in the FAQ.
>
> I've got an ATM networking application that spawns off multiple
> window threads to actually display sending and receiving ATM
> cells.
>
> The spawned windows are normal GTK top level windows, with
> gnome_less widgets in them displaying from a buffer.
>
> The problem I'm getting into is having the main callback functions
> be able to hit the non-global widgets in the spawned windows.
>
> I've tried the solution in the glade faq, but I can't seem to get it
> to work properly.
>
> Example (simplified):
>
> 1. main_window = lookup_widget(GTK_WIDGET(button), "main_window");
> 2. window = create_window();
> 3. gtk_widget_show(window);
> 4. gtk_object_set_data(GTK_OBJECT(main_window), "window" window);
> 5. windows = gtk_object_get_data(GTK_OBJECT(main_window), "window");
> 6. window_less = lookup_widget(windows, "windowless");
>
> Here is what I think I'm doing:
>
> Creating a pointer from the main window (and subsequent callback functions)
> to one of the spawned windows (4).
>
> Then calling the pointer to get data about the spawned window and set it to
> a variable (5).
>
> Finally using lookup_widget on the pointer I get from (5) to find the
> gnome_less
> widget "windowless" that is in one of the toplevel windows.
>
> I know I'm getting something back from all that mess, as lookup_widget
> doesn't barf, but when I try to display something on the widget, it crashes
> without much explaination.
>
> Sorry for the long post, but I'm really quite at a loss with this.
>
> Cheers,
>
> James Campbell