tuikit/core/widget.py
changeset 89 94f5baef19ac
parent 87 ee5ea9671f28
child 90 781774a8d568
equal deleted inserted replaced
88:90d00354dc70 89:94f5baef19ac
     1 from tuikit.core.coords import Point, Size
     1 from tuikit.core.coords import Point, Size
       
     2 from tuikit.core.theme import default_theme
     2 
     3 
     3 
     4 
     4 class Widget:
     5 class Widget:
     5 
     6 
     6     """Base class for all widgets."""
     7     """Base class for all widgets."""
    16 
    17 
    17         #: Parent Widget
    18         #: Parent Widget
    18         self.parent = None
    19         self.parent = None
    19         #: Window owning this Widget
    20         #: Window owning this Widget
    20         self.window = None
    21         self.window = None
       
    22         #: Theme
       
    23         self.theme = default_theme
    21 
    24 
    22         ### placing and size
    25         ### placing and size
    23         #: Position inside parent widget. Modified by layout manager.
    26         #: Position inside parent widget. Modified by layout manager.
    24         self.pos = Point()
    27         self.pos = Point()
    25         #: Actual size. Modified by layout manager.
    28         #: Actual size. Modified by layout manager.
    52 
    55 
    53     ## drawing ##
    56     ## drawing ##
    54 
    57 
    55     def draw(self, buffer, x, y):
    58     def draw(self, buffer, x, y):
    56         pass
    59         pass
       
    60 
       
    61     def set_theme(self, theme):
       
    62         self.theme = theme