Re: root windows



Dnia 26-05-2005, czw o godzinie 14:33 +0100, y g napisał:
Unless by "build of glade" you mean autogenerated C code, which is
bad,
bad, bad thing to use. Use libglade, really.
why it is bad? I use it and it works just fine and I don't have glade
dependiencies.
thank you both for your replies and correcting me.... toplevel windows
and glade autogenerated c code is what i have at the moment... about
the argument if autogenerated code is a bad thing.... well i dont have
much experience but i am starting to struggle a little bit now the
application is growing... but it really depends on what you wanna do i
guess...

I'd say refactor it to use libglade now, while it's still not too big.
It'll only get worse later.

autogenerated glade code it's easy to do, check inside one of the
files
generated will be function glade_get_widget_by_name() or something
similar, which works like glade_xml_get_widget ().
it's lookup_widget declared in support.h


it is indeed, however let me redescribe the scenario a bit more
correctly this time... let's say i have two toplevel windows win1 and
win2, one visible and hidden, each window has one button which when
pressed hides the current window and shows the other. my problem is
that on the callback looks like button1_onclicked (GtkWidget,
gpointer) the button pressed is passed as a parameter and i can use
lookup_widget to retrieve the toplevel window (or any other widget in
the window) but i don't know how to retrieve the pointer to the other
window...

Doesn't GtkWidget *win1 = lookup_widget("win1") work? If not, then pass
win1 as user_data param to g_signal_connect().

Cheers,
Maciej

-- 
Maciej Katafiasz <ml mathrick org>




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