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

Re: gEDA-user: next PCB release - 1.99za vs 4.0



On Thu, 2010-09-09 at 11:41 +0200, Frank Bergmann wrote:
> On 09.09.2010 02:46, Andrew Poelstra wrote:
> > Well, I am converting the top-level window to its own widget, rather than
> > using a stock GtkWindow and tacking stuff onto it. That way I can migrate
> > a lot of the global variables to member variables, pass more things as
> > parameters, and use the 'const' keyword a lot more.
> 
> Is it really necessary? I believe most GTK-apps use the ordinary way. If 
> you create its own widget you make it more complicated to (potential 
> new) developers not so familiar with this technique.
> 
> Did you take a look at g_object_get_data/g_object_set_data 
> (http://library.gnome.org/devel/gobject/stable/gobject-The-Base-Object-Type.html#g-object-get-data)? 
> Maybe this can help putting some of the global variables in the main window.

I don't know why, but I have quite an aversion to those particular APIs.
It kind-of feels like you're forcing data-storage onto an object which
doesn't intrinsically care.

OTOH, I guess as you've suggested, it does provide a mechanism to bind
data-ownership and life-time to an object without worrying about
sub-classing it or using extra code to manage them together.


-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)
Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)



_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user