RE: getting widgets by name



"John Darrington" wrote on Thu, 5 Jun 2003:
> I'm often wanting to access a widget, given only its name (as given 
> by gtk_widget_set_name ).  Currently I  can't see any way to do this.

If you use Glade to build your GUI then Glade provides a lookup_widget()
function. However, I sometimes get irritated by the fact that in 
addition to the name of the widget you are seeking, lookup_widget() also
requires a GtkWidget* to an ancestor of the unknown widget.

> I wondered what people think of the idea of having a function 
> such as
> 
> GSList * gtk_widget_get_widgets_by_name(char *name);
> 
> which would return all widgets which have been created with a 
> particular name.  

Great idea!  In this way, one method could be used to look up 
widgets whether they were created with Glade or not. 

--
Ken Rastatter, Senior Design Engineer
Honeywell Sensotec
"These opinions are mine and not necessarily those of Honeywell."



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