On Mon, Jan 19, 2004 at 09:55:34AM +0100, Antoon Pardon wrote: > On Fri, Jan 16, 2004 at 03:33:12PM -0200, Christian Robottom Reis wrote: > > 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). > > But if that is the purpose, why not use a GdkWinow instead of > the DrawingArea.
AIUI you aren't supposed to use a GdkWindow as a widget (i.e., add it to other container widgets, connect to signals, etc) -- the bare essentials that GtkWidget provides are required if you want widget-like access. IIRC the GtkDrawingArea is the simplest GTK+ widget (because it simply uses to the GtkWidget foundation to offer access to its GdkWindow). > > 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>. > > It probably is. But it makes the tutorial a bit hard to understand. > Section 12.2 Talk about the drawing methods and introduces them as: [snipped comments on low understandability] You have a good point. I'm not sure what the correct way to avoid this is -- perhaps the correct thing would be to add a FAQ item for this issue and point newcomers there. Does that sound like a good solution? If so, would you like to contribute the FAQ text? :-) 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/
