Quick search

Table Of Contents

Splitter

New in version 1.5.0.

_images/splitter.jpg

Warning

This widget is still experimental, and its API is subject to change in a future version.

The Splitter is a widget that helps you re-size it’s child widget/layout by letting the user control the size of it’s child by dragging the boundary. This widget like Scrollview 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

Change size of the strip/border used to resize:

splitter.strip_size = '10pt'

Change appearance:

splitter.strip_cls = your_custom_class

You could also change the appearance of the strip_cls which defaults to SplitterStrip by overriding the kv rule for like so 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)

Bases: kivy.uix.boxlayout.BoxLayout

See module documentation.

Events :
on_press:

Fired when the splitter is pressed

on_release:

Fired when the splitter is released

Changed in version 1.6.0: Added on_press and on_release events

border

Border used for BorderImage graphics instruction.

It must be a list of four values: (top, right, bottom, left). Read the BorderImage instruction for more information about how to use it.

border is a ListProperty, default to (4, 4, 4, 4)

max_size

Specifies the maximum size beyond which the widget is not resizable

max_size is a NumericProperty defaults to 500pt

min_size

Specifies the minimum size beyond which the widget is not resizable

min_size is a NumericProperty defaults to 100pt

sizable_from
Specifies wether the widget is resizable from ::
left, right, top or bottom

sizable_from is a OptionProperty defaults to left

strip_cls

Specifies the class of the resize Strip

strip_cls is a kivy.properties.ObjectProperty defaults to SplitterStrip which is of typeButton

strip_size

Specifies the size of resize strip

strp_size is a NumericProperty defaults to 10pt