Module albow.layout.Column
Source code
from typing import List
from albow.core.ui.Widget import Widget
from albow.layout.RowOrColumn import RowOrColumn
class Column(RowOrColumn):
"""
A Column is a container widget that arranges its contents in a vertical column. In an
OpenGL window, it may contain 3D subwidgets.
.. Note::
The layout is only performed when the widget is initially created; it is not updated if you add or remove
widgets later or change their sizes.
"""
def __init__(self, items: List[Widget], height=None, **kwds):
"""
Specify the following as keyword: value pairs in kwds
- align:
The widgets in items are added as subwidgets and arranged vertically with spacing pixels between.
Horizontal alignment is controlled by align, which is one of 'l', 'c' or 'r' for left, center or right.
- spacing: The spacing between the widgets in pixels
- equalize:
If equalize contains 'w', the widths of all the items are made equal to the widest one, and 'lr' is
added to their anchor properties. If equalize contains 'h', the heights of all the items are
made equal to the tallest one.
- expand: The index of the widget in the items list
Args:
items: The widgets to add as items
height: If a height is specified, then expand may be a widget or an index into the items, and the specified
widget has its height adjusted to fill the remaining space. Otherwise, the initial size of the
Column is calculated from its contents.
**kwds:
"""
self.d = (0, 1)
self.minor_axis = 'w'
self.axis = 'v'
self.longways = 'height'
self.crossways = 'width'
self.align_map = {
'l': (0, 'topleft', 'bottomleft'),
'c': (1, 'midtop', 'midbottom'),
'r': (2, 'topright', 'bottomright'),
}
super().__init__(height, items, kwds)
def __repr__(self):
return self.__class__.__name__
Classes
class Column (items, height=None, **kwds)
-
A Column is a container widget that arranges its contents in a vertical column. In an OpenGL window, it may contain 3D subwidgets.
Note
The layout is only performed when the widget is initially created; it is not updated if you add or remove widgets later or change their sizes.
Specify the following as keyword: value pairs in kwds
-
align: The widgets in items are added as subwidgets and arranged vertically with spacing pixels between. Horizontal alignment is controlled by align, which is one of 'l', 'c' or 'r' for left, center or right.
-
spacing: The spacing between the widgets in pixels
-
equalize: If equalize contains 'w', the widths of all the items are made equal to the widest one, and 'lr' is added to their anchor properties. If equalize contains 'h', the heights of all the items are made equal to the tallest one.
-
expand: The index of the widget in the items list
Args
items
- The widgets to add as items
height
- If a height is specified, then expand may be a widget or an index into the items, and the specified widget has its height adjusted to fill the remaining space. Otherwise, the initial size of the Column is calculated from its contents.
**kwds:
Source code
class Column(RowOrColumn): """ A Column is a container widget that arranges its contents in a vertical column. In an OpenGL window, it may contain 3D subwidgets. .. Note:: The layout is only performed when the widget is initially created; it is not updated if you add or remove widgets later or change their sizes. """ def __init__(self, items: List[Widget], height=None, **kwds): """ Specify the following as keyword: value pairs in kwds - align: The widgets in items are added as subwidgets and arranged vertically with spacing pixels between. Horizontal alignment is controlled by align, which is one of 'l', 'c' or 'r' for left, center or right. - spacing: The spacing between the widgets in pixels - equalize: If equalize contains 'w', the widths of all the items are made equal to the widest one, and 'lr' is added to their anchor properties. If equalize contains 'h', the heights of all the items are made equal to the tallest one. - expand: The index of the widget in the items list Args: items: The widgets to add as items height: If a height is specified, then expand may be a widget or an index into the items, and the specified widget has its height adjusted to fill the remaining space. Otherwise, the initial size of the Column is calculated from its contents. **kwds: """ self.d = (0, 1) self.minor_axis = 'w' self.axis = 'v' self.longways = 'height' self.crossways = 'width' self.align_map = { 'l': (0, 'topleft', 'bottomleft'), 'c': (1, 'midtop', 'midbottom'), 'r': (2, 'topright', 'bottomright'), } super().__init__(height, items, kwds) def __repr__(self): return self.__class__.__name__
Ancestors
Subclasses
Inherited members
RowOrColumn
:add
add_anchor
add_centered
anchor
attention_lost
augment_mouse_event
bg_color
bg_image
border_color
border_width
call_handler
call_parent_handler
defer_drawing
dismiss
draw
draw_over
fg_color
focus
focus_switch
font
get_cursor
get_focus
get_margin_rect
get_root
get_top_widget
get_visible
global_to_local
has_focus
inherited
invalidate
is_gl_container
key_down
key_up
local_to_global
margin
menu_bar
parent
parent_resized
present
rect
relative_mode
remove
remove_anchor
resized
scale_bg
sel_color
set_parent
set_size_for_text
tab_stop
visible
-