Divider¶
A separator used to visually distinguish two sections of content in a layout.





Screenshot not available
Not supported
Usage¶
To separate two labels stacked vertically with a horizontal line:
import toga
from toga.style.pack import Pack, COLUMN
box = toga.Box(
children=[
toga.Label("First section"),
toga.Divider(),
toga.Label("Second section"),
],
direction=COLUMN,
flex=1,
margin=10
)
The direction (horizontal or vertical) can be given as an argument. If not specified, it will default to horizontal.
Reference¶
toga.Divider ¶
Divider(id=None, style=None, direction=HORIZONTAL, **kwargs)
Bases: Widget
Create a new divider line.
| PARAMETER | DESCRIPTION |
|---|---|
id
|
The ID for the widget.
TYPE:
|
style
|
A style object. If no style is provided, a default style will be applied to the widget.
TYPE:
|
direction
|
The direction in which the divider will be drawn. Either
TYPE:
|
kwargs
|
Initial style properties.
DEFAULT:
|
enabled
property
writable
¶
enabled
Is the widget currently enabled? i.e., can the user interact with the widget?
Divider widgets cannot be disabled; this property will always return True; any attempt to modify it will be ignored.