docs/widget.rst
changeset 2 684cdc352562
child 5 ae128c885d0f
equal deleted inserted replaced
1:69318aba22bf 2:684cdc352562
       
     1 Widget
       
     2 ======
       
     3 
       
     4 .. toctree::
       
     5    :maxdepth: 2
       
     6 
       
     7    container
       
     8    button
       
     9 
       
    10 Class attributes
       
    11 ----------------
       
    12 
       
    13 .. attribute:: Widget.parent
       
    14 
       
    15 .. attribute:: Widget.top
       
    16 
       
    17 .. attribute:: Widget.x
       
    18 
       
    19 .. attribute:: Widget.y
       
    20 
       
    21 .. attribute:: Widget.width
       
    22 
       
    23 .. attribute:: Widget.height
       
    24 
       
    25 .. attribute:: Widget.hidden
       
    26 
       
    27 .. attribute:: Widget.allowlayout
       
    28 
       
    29 
       
    30 Event management
       
    31 ----------------
       
    32 
       
    33 .. classmethod:: Widget.newevent(event)
       
    34 
       
    35    Create new event with empty handler list.
       
    36 
       
    37 
       
    38 .. classmethod:: Widget.connect(event, handler)
       
    39 
       
    40    Add handler to handler list of the event.
       
    41 
       
    42 
       
    43 .. classmethod:: Widget.disconnect(event, handler=None)
       
    44 
       
    45    Remove handler from event's handler list. If no handler is given, remove all handlers.
       
    46 
       
    47 
       
    48 .. classmethod:: Widget.handle(event, ...)
       
    49 
       
    50    Call all handlers from event's handler list.
       
    51    This is used when user defined handlers are to be called.
       
    52 
       
    53 
       
    54 .. classmethod:: Widget.emit(event, ...)
       
    55 
       
    56    Emit event.
       
    57    This is used by original event source when the event is detected.