RE: [gtk-list] Abstracting the data from the ui..
- From: "Arjan J. Molenaar" <arjan xirion nl>
- To: "'gtk-list redhat com'" <gtk-list redhat com>
- Subject: RE: [gtk-list] Abstracting the data from the ui..
- Date: Tue, 26 Oct 1999 09:38:38 +0200
> -----Original Message-----
> From: Sean Cody [mailto:umcodysw@cc.UManitoba.CA]
> Sent: Tuesday, October 26, 1999 5:01 AM
> To: email@example.com
> Subject: [gtk-list] Abstracting the data from the ui..
> I trying to write some generic interfaces for a set of UI
> windows though I
> cannot seem to be able to pass data back and forth properly.
> Here is what I am doing.
> GtkWindow *MyWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> create widgets here ....
> add signal's here
> MyDataStructure refresh...?
> How do I actually update the data once the window is closed?
> (Is all data
> intended to be global and all windows modal??) Most of the
> data I would
> deal with is from dialog boxes who's input isn't needed until the
> dialog/window has been closed/destroyed.
> Your friendly neighbourhood posix junkie,
You can add data to GtkObjects by using gtk_object_set_data (or *_add_data...). It requires you to add a piece of data with a name (or use gtk_object_set_user_data).
Well, if you want to extract data from widgets, just add the widget as data to (for example) the window (or its parent). If you want the widget again, use gtk_object_get_data (). That's the way GLADE does it...
You can do the same trick with your own data structure of course.
] [Thread Prev