Skip to content

Commit

Permalink
fix: correctly initialize the root group
Browse files Browse the repository at this point in the history
  • Loading branch information
kalekundert committed Feb 27, 2021
1 parent 584d52c commit 825ba6f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions glooey/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ def __init__(self, window, batch=None, group=None):
self.__batch = batch or pyglet.graphics.Batch()
self.__spurious_leave_event = False

self._init_group(group)
# We need to instantiate an actual group if we weren't given one,
# because glooey interprets None as "my parent hasn't given me a group
# yet."
self._init_group(group or pyglet.graphics.Group())

window.push_handlers(self)

Expand Down Expand Up @@ -90,12 +93,6 @@ def _repack(self):

self._resize(self.territory)

def _regroup(self, group):
# We need to replace None with an actual group, because glooey
# interprets None as "my parent hasn't given me a group yet."
super()._regroup(group or pyglet.graphics.Group())


@autoprop
class Gui(Root):
custom_clear_before_draw = True
Expand Down

0 comments on commit 825ba6f

Please sign in to comment.