Containers
- class pyegui.Layout(scope_type)
Layout class can be used to specify layout of widgets that go after with statement.
Usage:
with Layout(LayoutType.VerticalCentered): heading("This widget will be horizontally centered")
Layout types:
Horizontal
Start a ui with horizontal layout.
Elements will be centered on the Y axis, i.e. adjusted up and down to lie in the center of the horizontal layout. Centering is almost always what you want if you are planning to mix widgets or use different types of text.
If you don’t want the contents to be centered, use HorizontalTop instead.
HorizontalCentered
Like Horizontal, but allocates the full vertical height and then centers elements vertically.
HorizontalTop
Like Horizontal, but aligns content with top.
HorizontalWrapped
Start a ui with horizontal layout that wraps to a new row when it reaches the right edge.
Elements will be centered on the Y axis, i.e. adjusted up and down to lie in the center of the horizontal layout. Centering is almost always what you want if you are planning to mix widgets or use different types of text.
Vertical
Start a ui with vertical layout. Widgets will be left-justified.
VerticalCentered
Start a ui with vertical layout. Widgets will be horizontally centered.
VerticalCenteredJustified
Start a ui with vertical layout. Widgets will be horizontally centered and justified (fill full width).
CenteredAndJustified
This will make the next added widget centered and justified in the available space.
Only one child widget is allowed!
- class pyegui.LayoutType
Values of this enum are used in Layout
- class pyegui.Scope
Create a scope for the contents. You can use this to temporarily change the Style of a sub-region
Usage:
with Scope(): set_opacity(0.5) heading("hi") heading("there") heading("normal opacity")
- class pyegui.Group
Visually groups the contents together.
Usage:
with Group(): heading("hi") heading("there")