Re: what's the best way to handle variables and objects?

2006-03-17 Thread Andreas Stricker
John (J5) Palmieri wrote: Yes. It depends on your application. Some people will subclass a GObject and add the window object plus all of the other widgets as aggregates. If you are feeling more daring you can subclass your main window where your app class would inherit from GtkWindow.

what's the best way to handle variables and objects?

2006-03-15 Thread Andreas Kotowicz
I'm looking for a clean solution on passing variables and objects from gtk calls to callback functions and back. I call for instance g_signal_connect(G_OBJECT(button), clicked, G_CALLBACK(clear_timer_cb), progressbar); and pass with it the object I'm working with. (progressbar has been definded

Re: what's the best way to handle variables and objects?

2006-03-15 Thread Tristan Van Berkom
Andreas Kotowicz wrote: [...] but what should I do if I want to modify any other variables in this function as well? let's say that in the part where I created the g_signal_connect there are also some variables A and B which might be of interest in clear_timer_cb. should I create a struct

Re: what's the best way to handle variables and objects?

2006-03-15 Thread Andreas Kotowicz
On Wed, 2006-03-15 at 13:44 -0500, John (J5) Palmieri wrote: You can create a generic struct but more often than not there is an application object or struct that the application developer creates which holds all the public variables he or she would care about which is passed as userdata to

Re: what's the best way to handle variables and objects?

2006-03-15 Thread Wallace Owen
My reply's in the body (I ain't no top-poster!): On Wed, 2006-03-15 at 22:57 +0100, Andreas Kotowicz wrote: On Wed, 2006-03-15 at 13:44 -0500, John (J5) Palmieri wrote: You can create a generic struct but more often than not there is an application object or struct that the application

Re: what's the best way to handle variables and objects?

2006-03-15 Thread John (J5) Palmieri
On Wed, 2006-03-15 at 22:57 +0100, Andreas Kotowicz wrote: On Wed, 2006-03-15 at 13:44 -0500, John (J5) Palmieri wrote: You can create a generic struct but more often than not there is an application object or struct that the application developer creates which holds all the public

Re: what's the best way to handle variables and objects?

2006-03-15 Thread Tristan Van Berkom
Andreas Kotowicz wrote: Hi Tristan, [...] do you know maybe a relatively simple gnome app which uses this concept, so I could have a look at the source code and see how all the interaction works? Well, how about I just type away from memory... after writing that I notice that its