[Glade-users] Window communication.



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

-- 
James Campbell          -|-   Embedded Systems Engineer
jcampbell omnigon com   -|-     Omnigon International    
pgp:  C323 70EC 6E2D 61CB 4692 14E4 4F79 3530 D49F A9CE
work: +1.760.804.8884 x 332       cell: +1.760.492.1176
--
"Computer games don't affect kids; I mean if Pac-Man 
affected us as kids, we'd all be running around darkened 
rooms, munching magic pills and listening to repetitive 
electronic music." 
         -Kristian Wilson, Nintendo, Inc. 1989 






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]