On Fri, Jan 16, 2004 at 04:41:22PM +0100, Antoon Pardon wrote: > I have just written my first application with a > gtk.DrawingArea. Can someone explain why I have to > do anything usefull with it I always have to > refer to the window attribute.
It probably stems from the fact that the DrawingArea is -- IIRC -- almost entirely designed to wrap its GdkWindow. IOW, it doesn't have any [relevant] methods of its own; it's just designed to allow you to do GDK calls without any widget features (which would be pretty undesireable for a canvas anyway). > Why not > > DA = gtk.DrawingArea() > ... > gc = DA.new_gc() > DA.draw_point(gc , x , y) > > instead of > > DA = gtk.DrawingArea() > ... > gc = DA.window.new_gc() > DA.window.draw_point(gc , x , y) > > The way it is done now just seems to > complicate things whithout good > reason. Note that it *used* to be (in GTK-1.2 era) just like you suggested -- the wrapper class for GtkDrawingArea proxied all its calls into its GdkWindow. I *think* James changed this because there was no longer a Python wrapper class in PyGTK-2.x, and perhaps to keep us as close as possible to the GTK+ bindings. (Haven't I answered this before?) At any rate, it's trivial to write a wrapper class in Python that proxies all calls to the GdkWindow; that is however left as an exercise to the reader <wink>. Take care, -- Christian Robottom Reis | http://async.com.br/~kiko/ | [+55 16] 261 2331 _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
