Table Of Contents
Splitter¶
バージョン 1.5.0 で追加.
The Splitter is a widget that helps you re-size it’s child
widget/layout by letting you re-size it via dragging the boundary or
double tapping the boundary. This widget is similar to the
ScrollView in that it allows only one
child widget.
Usage:
splitter = Splitter(sizable_from = 'right')
splitter.add_widget(layout_or_widget_instance)
splitter.min_size = 100
splitter.max_size = 250
To change the size of the strip/border used for resizing:
splitter.strip_size = '10pt'
To change its appearance:
splitter.strip_cls = your_custom_class
You can also change the appearance of the strip_cls, which defaults to
SplitterStrip, by overriding the kv rule in your app:
<SplitterStrip>:
horizontal: True if self.parent and self.parent.sizable_from[0] in ('t', 'b') else False
background_normal: 'path to normal horizontal image' if self.horizontal else 'path to vertical normal image'
background_down: 'path to pressed horizontal image' if self.horizontal else 'path to vertical pressed image'
-
class
kivy.uix.splitter.Splitter(**kwargs)[ソース]¶ ベースクラス:
kivy.uix.boxlayout.BoxLayoutSee module documentation.
Events: - on_press:
Fired when the splitter is pressed.
- on_release:
Fired when the splitter is released.
バージョン 1.6.0 で変更: Added on_press and on_release events.
-
border¶ Border used for the
BorderImagegraphics instruction.This must be a list of four values: (bottom, right, top, left). Read the BorderImage instructions for more information about how to use it.
borderis aListPropertyand defaults to (4, 4, 4, 4).
-
keep_within_parent¶ If True, will limit the splitter to stay within its parent widget.
keep_within_parentis aBooleanPropertyand defaults to False.バージョン 1.9.0 で追加.
-
max_size¶ Specifies the maximum size beyond which the widget is not resizable.
max_sizeis aNumericPropertyand defaults to 500pt.
-
min_size¶ Specifies the minimum size beyond which the widget is not resizable.
min_sizeis aNumericPropertyand defaults to 100pt.
-
rescale_with_parent¶ If True, will automatically change size to take up the same proportion of the parent widget when it is resized, while staying within
min_sizeandmax_size. As long as these attributes can be satisfied, this stops theSplitterfrom exceeding the parent size during rescaling.rescale_with_parentis aBooleanPropertyand defaults to False.バージョン 1.9.0 で追加.
-
sizable_from¶ Specifies whether the widget is resizable. Options are: left, right, top or bottom
sizable_fromis anOptionPropertyand defaults to left.
-
strip_cls¶ Specifies the class of the resize Strip.
strip_clsis ankivy.properties.ObjectPropertyand defaults toSplitterStrip, which is of typeButton.バージョン 1.8.0 で変更: If you set a string, the
Factorywill be used to resolve the class.
-
strip_size¶ Specifies the size of resize strip
strp_sizeis aNumericPropertydefaults to 10pt