diff --git a/kivy/uix/widget.py b/kivy/uix/widget.py index 7739922bf..d38cbbfbc 100644 --- a/kivy/uix/widget.py +++ b/kivy/uix/widget.py @@ -33,6 +33,24 @@ Our widget class is designed with a couple of principles in mind: You can also check if a widget collides with another widget with :meth:`Widget.collide_widget`. + +We also have some defaults that you should be aware of: + +* A :class:`Widget` is not a :class:`Layout`: it will not change the position + nor the size of its children. If you want a better positionning / sizing, use + a :class:`Layout`. + +* The default size is (100, 100), if the parent is not a :class:`Layout`. For + example, adding a widget inside a :class:`Button`, :class:`Label`, will not + inherit from the parent size or pos. + +* The default size_hint is (1, 1). If the parent is a :class:`Layout`, then the + widget size will be the parent/layout size. + +* All the :meth:`Widget.on_touch_down`, :meth:`Widget.on_touch_move`, + :meth:`Widget.on_touch_up` doesn't do any sort of collisions. If you want to + know if the touch is inside your widget, use :meth:`Widget.collide_point`. + Using Properties ---------------- @@ -54,6 +72,8 @@ widget moves, you can bind your own callback function like this:: wid = Widget() wid.bind(pos=callback_pos) +Read more about the :doc:`/api-kivy.properties`. + ''' __all__ = ('Widget', 'WidgetException')