wxtest.py is almost totally broken under Linux for me; I think this is
what it means by:
# GDK sort of works, but keeps getting overdrawn by the window background
#   (resize to see).
in the source code.

I tracked down the problem.  The issue is that GTK widgets are
double-buffered by default, so the expose event handler does this:

prepare a back buffer to draw into
tell the user code to draw
  (here, pyglet draws directly into the window, bypassing GTK's back buffer)
copy the (still blank) back buffer into the window, overwriting what
pyglet just drew

The fix is to turn off double buffering:

Index: wxtest.py
===================================================================
--- wxtest.py   (revision 2446)
+++ wxtest.py   (working copy)
@@ -118,6 +118,8 @@
     def __init__(self, parent, id=-1, config=None, context=None):
         super(GTKWxCanvas, self).__init__(parent, id, config, context)

+        self.SetDoubleBuffered(False)
+
         self._glx_context = self._context._context
         self._x_display = self._config._display
         self._x_screen_id = self._screen._x_screen_id

Note that this requires a non-ancient version of wxPython; Debian's
2.6.3.2.2-3 is too old (doesn't have the SetDoubleBuffered method
wrapped in wxPython, although it does exist in the underlying
wxwidgets). Debian's 2.8.7.1-1.1 works fine.  I don't know when
SetDoubleBuffered was added...

When you apply this patch, you should probably also adjust the comment
at the top of the file.

Carl

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to