Re: closing a spawned window

is this something that I must do for -every- combination of required
data for all my callbacks?  Or should I just create one enourmous
structure and set only the needed elements in that?

Seems inefficient.

Also, some of this data isn't stuff that I know how to access
-anywhere-.  I used glade to create the interface, so, for example, if I
want to use a button to save what was typed into a text field, how do I
retrieve the text to be saved?  I can't access the textbox widget
itself, because that was created by glade in the "interface.c" file and
I have no way to store a pointer to that widget.  If I edit interface.c,
glade will just overwrite my changes when I edit the interface.

Is there a way to retrieve pointers to a specific widget from within the


On Wed, 2002-06-19 at 11:03, Olivier Fourdan wrote:

I would create a structure (typedef) with all required data and pass a
pointer to a variable of that type.

Then, in your callback function, just retreive the data by casting
gpointer* to the proper typedef.


On Wed, 2002-06-19 at 18:20, Ronald Roth wrote:

I have an application which spawns another toplevel window.  I would
like the user to be able to close this window by clicking on
File->Close.  I currently have the callback for that menuitem call
another function which does some cleanup (Saving date, etc), and then I
wish to close the window.  However, I don't know what to pass to
gtk_widget_destroy().  The only data that's available in my callback is
the GtkMenuItem that was clicked.  How do I get the widget that I need
to delete the toplevel window?

I often have problems like these.  I have a button whose callback needs
data about some other widget elsewhere in my program.  In general, how
do I pass this data to my callback or retrieve the data from within the

Thanks!  I hope my question was clear.  Please forgive me if the answer
is obvious.

gtk-app-devel-list mailing list
gtk-app-devel-list gnome org

Olivier               <fourdan xfce org>  
XFce is a lightweight  desktop  environment  for  various *NIX systems.
Designed for productivity,  it loads  and  executes  applications fast,
while conserving  system resources. XFce is all free software, released
under GNU General Public License.    Available from

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