Re: Search for lowest level widget



On Mon, 10 May 2004, Russell Shaw wrote:
I have a GtkTable with cells filled with a widget that contains
another widget, and another. The lowest level widget in each cell
is a GtkEntry. Given the GtkTable, how can i get a pointer to the
lowest level GtkEntry in a cell?
Hello Russell!
First you have to find the widget that is directly attached to the table
cell. There is no simple function call since a widget can span more than
one cell in a table. You would need to access the GtkTableChild structure,
but I'm not sure how to do this. You could try whether GtkTable->children
really only stores GtkWidgets like the doc says, or if you're lucky it
stores GtkTableChild's.
When you found the top widget of the desired table cell you have to go
down the tree until you find your GtkEntry. How this is done in detail
depends on the type of widgets you pack between the table and the entry.
GList*      gtk_container_get_children      (GtkContainer *container);
and
GtkWidget*  gtk_bin_get_child               (GtkBin *bin);
can be used for that.
Probably it's easier to store global pointers to the entry widgets you
need to access later.

Regards,
                     Peter
-- 
====================================================================
Peter Krüger

applied software solutions (appss) GmbH
Sandtorstr. 23
D-39106 Magdeburg
Germany

Phone:  +49-(0)391-54486-19388
Fax:    +49-(0)391-54486-19222
email:  krueger appss de
URL:    http://www.appss.de/

Managing Director: Uwe Hess, Dietmar Schäfer
Register: HRB12386, AG Magdeburg

"Virtual business becomes reality!"

This e-mail may contain confidential and/or privileged information. If
you are not the intended recipient (or have received this e-mail in
error) please notify the sender immediately and destroy this e-mail. Any
unauthorised copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
====================================================================




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