mirror of https://github.com/kivy/kivy.git
doc: revisions to uix/boxlayout.py
This commit is contained in:
parent
719ef95d42
commit
4d35e9a8cb
|
@ -32,10 +32,10 @@ example, we use 10 pixel spacing between children; the first button covers
|
||||||
layout.add_widget(btn1)
|
layout.add_widget(btn1)
|
||||||
layout.add_widget(btn2)
|
layout.add_widget(btn2)
|
||||||
|
|
||||||
Position hint are also partially working, depending the orientation:
|
Position hints are partially working, depending on the orientation:
|
||||||
|
|
||||||
* If the orientation is `vertical`: `x`, `right` and `center_x` will be used
|
* If the orientation is `vertical`: `x`, `right` and `center_x` will be used.
|
||||||
* If the orientation is `horizontal`: `y`, `top` and `center_y` will be used
|
* If the orientation is `horizontal`: `y`, `top` and `center_y` will be used.
|
||||||
|
|
||||||
You can check the `examples/widgets/boxlayout_poshint.py` for a live example.
|
You can check the `examples/widgets/boxlayout_poshint.py` for a live example.
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ You can check the `examples/widgets/boxlayout_poshint.py` for a live example.
|
||||||
btn3 = Button(text='World', size_hint=(.5, 1))
|
btn3 = Button(text='World', size_hint=(.5, 1))
|
||||||
|
|
||||||
The first button will be 200px wide as specified, the second and third
|
The first button will be 200px wide as specified, the second and third
|
||||||
will be 300px each, e.g., (800-200)*0.5
|
will be 300px each, e.g. (800-200) * 0.5
|
||||||
|
|
||||||
|
|
||||||
.. versionchanged:: 1.4.1
|
.. versionchanged:: 1.4.1
|
||||||
|
@ -71,8 +71,8 @@ class BoxLayout(Layout):
|
||||||
spacing = NumericProperty(0)
|
spacing = NumericProperty(0)
|
||||||
'''Spacing between children, in pixels.
|
'''Spacing between children, in pixels.
|
||||||
|
|
||||||
:data:`spacing` is a :class:`~kivy.properties.NumericProperty`, default to
|
:data:`spacing` is a :class:`~kivy.properties.NumericProperty` and defaults
|
||||||
0.
|
to 0.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
padding = VariableListProperty([0, 0, 0, 0])
|
padding = VariableListProperty([0, 0, 0, 0])
|
||||||
|
@ -86,16 +86,16 @@ class BoxLayout(Layout):
|
||||||
|
|
||||||
Replaced NumericProperty with VariableListProperty.
|
Replaced NumericProperty with VariableListProperty.
|
||||||
|
|
||||||
:data:`padding` is a :class:`~kivy.properties.VariableListProperty`, default to
|
:data:`padding` is a :class:`~kivy.properties.VariableListProperty` and
|
||||||
[0, 0, 0, 0].
|
defaults to [0, 0, 0, 0].
|
||||||
'''
|
'''
|
||||||
|
|
||||||
orientation = OptionProperty('horizontal', options=(
|
orientation = OptionProperty('horizontal', options=(
|
||||||
'horizontal', 'vertical'))
|
'horizontal', 'vertical'))
|
||||||
'''Orientation of the layout.
|
'''Orientation of the layout.
|
||||||
|
|
||||||
:data:`orientation` is an :class:`~kivy.properties.OptionProperty`, default
|
:data:`orientation` is an :class:`~kivy.properties.OptionProperty` and
|
||||||
to 'horizontal'. Can be 'vertical' or 'horizontal'.
|
defaults to 'horizontal'. Can be 'vertical' or 'horizontal'.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue