Hello, I'm new to this mailing list.
I'm trying to make a program that run on Linux & Win32.
I choose python and gtk+2 .
I have a curious bug. It's probably a bug in the gdk dll (and so I may
be off topic), but I'm not sure. It could also be the pygtk layer...
Anyway I didn't saw any topics on this in the pygtk list nor the gtk+
list.
Here is a short program :
---- snip
#! /usr/bin/env python
import gtk
GDK=gtk.gdk
def expose_event (widget,event):
widget.window.draw_polygon(widget.get_style().black_gc,
gtk.TRUE,[(100,100),(200,100),(200,200),(100,200)])
widget.window.draw_polygon(widget.get_style().black_gc,
gtk.FALSE,[(150,150),(250,150),(250,250),(150,250)])
widget.window.draw_rectangle (widget.get_style().white_gc, gtk.TRUE,1,1,50,50)
w = gtk.Window ()
da = gtk.DrawingArea ()
da.set_size_request(300, 300)
w.add (da)
w.show_all ()
da.set_events(GDK.EXPOSURE_MASK |
GDK.LEAVE_NOTIFY_MASK |
GDK.BUTTON_PRESS_MASK |
GDK.POINTER_MOTION_MASK |
GDK.POINTER_MOTION_HINT_MASK)
da.connect("expose_event", expose_event)
w.connect ('destroy',gtk.mainquit)
gtk.mainloop ()
----snip
This code should show 2 black regtangles in the middle of the window,
one filled, one not. (And also a white rectagle in the upper left corner)
this code runs perfectly on Linux, but produce curious results under window.
The polygons (in fact black rectangles) are messed. The points are completly outside
the window. In fact, resizing the window seems to change the points values !
The draw_rectangle (white rectangle) is working OK.
I don't know where is the bug. I suspect the gdk dll;
I'm using the ones on http://www.gimp.org/~tml/gimp/win32/downloads.html
(gtk+-2.0.0-20020310.zip)
Python is 2.2.1 (Windows & Linux)
pygtk is 1.99.9 (Linux) & 1.99.8 (Windows)
the windows pygtk version is the one someone posted to the list.
I didn't manage to recompile the gdk DLL from source (I may lack tools on windows)
windows vesrion is XP but I doubt it matters.
Is someone else also seeing this problem ?
Yann Dupont.
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/