Skip to content

Commit

Permalink
OpenGL: only redrawing on <Expose>
Browse files Browse the repository at this point in the history
  • Loading branch information
unhyperbolic committed Jan 29, 2024
1 parent 44bfccf commit 82d819b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions opengl/CyOpenGL.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,17 @@ class RawOpenGLWidget(Tk_.Widget, Tk_.Misc):

Tk_.Widget.__init__(self, master, 'togl', cnf, kw)
self.root = master
self.bind('<Map>', self.tkMap_expose_or_configure)

# We do not have a valid framebuffer yet.
#self.bind('<Map>', self.tkMap_expose_or_configure)
#self.bind('<Configure>', self.tkMap_expose_or_configure)

# We have a valid framebuffer by the time we get the first
# <Expose> event.
# Binding <Expose> to draw will redraw every time the window
# becomes visible. In particular, it will cause the first draw.

self.bind('<Expose>', self.tkMap_expose_or_configure)
self.bind('<Configure>', self.tkMap_expose_or_configure)

self.initialized = False

Expand Down

0 comments on commit 82d819b

Please sign in to comment.