Re: [glade--]Newbie question : how to access a contained object ?
Christof Petig <[email protected]> Wed, 18 Feb 2004 12:45:54 +0100
| Newsgroups | gmane.comp.gnome.glademm |
|---|---|
| Organization | Adolf Petig GmbH & Co. KG |
| Message-ID | <[email protected]> |
Pierre Bacquet schrieb:
> Hello,
>
> I am trying to learn the basics of GTKmm and Glade.
>
> I have designed a very simple Window with 1 button and a text
> field (Gtk::Entry). I have setup call-backs for the button.
>
> I would like to display some text in the text field
> when I click on the button. The problem I have is that Glademm
> generates the pointer to the text field as a local variable of the
> constructor of my window; hence, I don't know how to get a pointer
> of the text area when my call-back is triggered.
>
> If I use Glade C code generator, I can manage to get a pointer on
> the text area using lookup_widget() passing it the name of my text
> area; but, with the C++ code generator, I am stuck.
mark the text widget's visibility as protected or higher. That's all. No
voodoo like lookup_widget() required.
Christof