On Thu, Dec 18, 2003 at 10:05:20AM -0600, John Hunter wrote:
> >>>>> "Luc" == Luc Lefebvre <[EMAIL PROTECTED]> writes:
>
> Luc> Hi, I am experimenting with glade/gtk and python. (python
> Luc> 2.2, glade2, gtk-1.2). I tried an example with a window and
> Luc> a simple DrawingArea. I can get the window up and bind the
> Luc> mainquit method to the event but when I try any of the draw
> Luc> functionis (for ex. draw_point) it doesn't work. I get the
> Luc> message:
>
> It's not a glade problem. The traceback is correct, gtk.DrawingArea
> doesn't have the draw_point method. gtk.gdk.Drawable does
>
> When the application is realized, you'll be passed at gtk.DrawingArea
> widget. The window attribute of that widget is a gtk.gdk.Drawable.
> Here is a simple example that illustrates how to draw.
>
Just as an explanation to what confused Luc: the "old", 0.6,
gtk.GtkDrawingArea *had* API which proxied all calls to the underlying
GdkWindow. So it used to be okay to do
drawingarea.draw_point()
-- the GtkDrawingArea.draw_point() method proxied over to the
GdkWindow's draw_point() method.
This convenience doesn't exist in PyGTK-2 (it was mainly a subproduct
borne out of the fact that we had Python wrapper classes), so you need
to use
drawingarea.window.draw_point().
now. I'll update the upgrade item in the FAQ to clear up the confusion.
PS: Luc, you're not using GTK+ 1.2, even if you think you are <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/