Re: Widgets across windows
- From: Mihai Bazon <mbazon websci ro>
- To: Eric Lesh <eclesh pacbell net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Widgets across windows
- Date: Sat, 28 Jul 2001 13:29:12 +0300
Hi,
find answer embedded in your mail.
Cheers,
Mishoo
On Fri, 27 Jul 2001 23:28:33 -0700
Eric Lesh <eclesh pacbell net> wrote:
I come from Visual Basic ...
Ohh...! That's terrible!
I have a window wndMain with a button btnRand. When btnRand is pressed,
it is supposed to generate a random string, place the random string in
rndstr, and then place the value of rndstr in rndbox, a text box on form
wndRand. When I use:
GtkWidget *rndtxt, *wndRand;
wndRand = create_wndRand();
rndtxt = lookup_widget(GTK_WIDGET(button), "rndbox");
Use instead:
rndtxt = lookup_widget(wndRand, "rndbox");
This means: you're right, you must specify the parent widget (which is
wndRand). What I don't see is who is "button"?
Also, from this code I understand you're using Glade to generate the
source code. That's good, but may not work unless you selected "set
widget names" checkbox, somewhere in the project preferences dialog.
Yet another thing: Glade provides another (very powerful) way to load the
graphical interface: you save every window in a .glade file, which is
basically a XML file, and it provides a separate library which you can use
to load and show the widgets defined in that file. This way you don't
mess with Glade generated code, which is sometimes hard to modify or
improve. So, for more iofo about this check "libglade" --
http://glade.pn.org.
and run it, I get the error "** WARNING **: Widget not found: rndbox"
In my experience with Visual Basic, you have to specify that the widget
(rndbox) is on a different form than the button (btnRand). If I do have
to do this, what is the code to do so?
Gxis posxte
-Eric
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
--
... and on the seventh day, He exited from append mode.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]