Re: Gtk/Glade Beginner: widget lookup, text input etc



On Thursday 11 December 2003 03:17, Dimitar Haralanov wrote:

Sukrit K Mehra <holysmoke amaltaas biz> wrote:
1. What exactly does lookup_widget do?
If I have a widget called diaog1 in a file interface.c in order to
destroy/hide/show it I need a pointer to it. Can I do something like
GtkWidget *localname = lookup_widget(GtkWidget "External Name",
localname); On account of this, the following should work ...

      You do the following (assuming that in the fuction that you are doing
it in you have a widget which is part of the same tree of widgets as
the one you are looking for):

      GtkWidget *localwidget = lookup_widget (button, "dialog1");
      (assuming button is a GtkWidget * and is part of dialog1)

This will return the pointer to your dialog1 widget.

What if the I don't have a reference button widget from same Widget Tree?

How can I do the following?
I have a form that comes up upon activation of a menuitem using 
create_about_dialog or any such function. Now on click of button on the 
dialog window I -
1. get input from text fields - gtk_entry_get_text - as described by you 
earlier.
2. destroy the dialog window.
3. Now I need to display this information in another window, that is _not_ a 
part of the same widget tree. How do I do this? 

Ideally, I would get a reference(pointer) to that widget and display the text 
there. Is there any way that this can be done.

How can I get that reference? If it's too clumsy then how do I share the data 
otherwise?

Do I put the data in a file and tell the widget to read it from there. Even 
then the I would have to tell the widget to refresh it's view for which I 
would need a reference to it.

Lead me to light.

Thanks & Regards

-- 
Sukrit K Mehra
Email Id: holysmoke amaltaas biz
Website: http://www.symonds.net/~holysmoke





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