tuikit/core/container.py
changeset 94 e50dae408fe9
parent 93 c1e79acb9fcb
child 97 0c2e0c09ba5c
equal deleted inserted replaced
93:c1e79acb9fcb 94:e50dae408fe9
    26 
    26 
    27     def resize(self, w, h):
    27     def resize(self, w, h):
    28         Widget.resize(self, w, h)
    28         Widget.resize(self, w, h)
    29         self.layout.resize()
    29         self.layout.resize()
    30 
    30 
    31     def draw(self, buffer, x=0, y=0):
    31     def draw(self, buffer):
    32         """Draw child widgets."""
    32         """Draw child widgets."""
       
    33         Widget.draw(self, buffer)
    33         for child in self.children:
    34         for child in self.children:
    34             cx = x + child.x
    35             with buffer.moved_origin(child.x, child.y):
    35             cy = y + child.y
    36                 with buffer.clip(buffer.origin.x, buffer.origin.y,
    36             with buffer.clip(cx, cy, child.width, child.height):
    37                                  child.width, child.height):
    37                 child.draw(buffer, cx, cy)
    38                     child.draw(buffer)
    38 
    39 
    39     def set_theme(self, theme):
    40     def set_theme(self, theme):
    40         Widget.set_theme(self, theme)
    41         Widget.set_theme(self, theme)
    41         for child in self.children:
    42         for child in self.children:
    42             child.set_theme(theme)
    43             child.set_theme(theme)