mirror of
https://github.com/jtgans/g13gui.git
synced 2025-06-20 00:14:09 -04:00
g13gui: bitwidgets: Fix a few bugs in widget
This commit is contained in:
parent
5f5b1e0879
commit
caa316c850
@ -62,17 +62,17 @@ class Widget(Subject, Observer):
|
||||
|
||||
def addChild(self, child):
|
||||
self._children.append(child)
|
||||
self._children.parent = self
|
||||
child.parent = self
|
||||
child.registerObserver(self, 'valid')
|
||||
self.addChange(ChangeType.ADD, 'child', child)
|
||||
self.notifyChange()
|
||||
self.notifyChanged()
|
||||
|
||||
def removeChild(self, child):
|
||||
child.removeObserver(self)
|
||||
self._children.remove(child)
|
||||
child.parent = None
|
||||
self.addChange(ChangeType.REMOVE, 'child', child)
|
||||
self.notifyChange()
|
||||
self.notifyChanged()
|
||||
|
||||
@property
|
||||
def visible(self):
|
||||
@ -95,7 +95,7 @@ class Widget(Subject, Observer):
|
||||
self.visible = True
|
||||
|
||||
def draw(self, ctx):
|
||||
if self._visible:
|
||||
if self.visible:
|
||||
for child in self._children:
|
||||
if child.visible():
|
||||
if child.visible:
|
||||
child.draw(ctx)
|
||||
|
Loading…
Reference in New Issue
Block a user