GLXCurses.Box module¶
-
class
GLXCurses.Box.
Box
[source]¶ Bases:
GLXCurses.Container.Container
Description: The
Box
widget organizes child widgets into a rectangular area.-
baseline_position
¶ Gets the
baseline_position
value.Returns: a GLXC.BaselinePosition Return type: GLXC.BaselinePosition
-
homogeneous
¶ Returns whether the
Box
is homogeneous (all children’s have the same size).See also
Box.set_homogeneous()
Returns: True
if theBox
is homogeneous.Return type: bool
-
spacing
¶
-
new
(orientation='HORIZONTAL', spacing=None)[source]¶ Creates a new
Box
.Parameters: - orientation (Orientation) – the box’s orientation. Default: ORIENTATION_HORIZONTAL
- spacing (int or None) – the number of characters to place by default between children. Default: 0
Returns: a new
Box
.Raises: - TypeError – if
orientation
is not glxc.ORIENTATION_HORIZONTAL or glxc.ORIENTATION_VERTICAL - TypeError – if
spacing
is not int type or None
-
pack_start
(child=None, expand=True, fill=True, padding=None)[source]¶ Adds child to
Box
, packed with reference to the start ofBox
.Parameters: - child (a GLXCures Object) – the widget to be added to
Box
- expand (bool) –
True
if the new child is to be given extra space allocated to Box <GLXCurses.Box.Box>. The extra space will be divided evenly between all children that use this option - fill (bool) –
True
if space given tochild
by theexpend
option is actually allocated tochild
, rather than just padding it. This parameter has no effect ifexpend
is set toFalse
. A child is always allocated the full height of a horizontalBox
and the full width of a verticalBox
. This option affects the other dimension. - padding (int or None) – extra space in characters to put between this child and its neighbors, over and above the global amount specified by
spacing
attribute. If child is a widget at one of the reference ends of box , then padding pixels are also put between child and the reference edge of box
Raises: - TypeError – if
child
is not a GLXCurses type as tested byglxc_type()
- TypeError – if
expand
is not bool type - TypeError – if
fill
is not bool type - TypeError – if
padding
is not int or None
- child (a GLXCures Object) – the widget to be added to
-
pack_end
(child=None, expand=True, fill=True, padding=None)[source]¶ Adds child to GLXCurses.Box once to the end of GLXCurses.Box .
Parameters: - child (GLXCurses.Widget) – the widget to be added to GLXCurses.Box
- expand (bool) –
True
if the new child is to be given extra space allocated to GLXCurses.Box . The extra space will be divided evenly between all children that use this option - fill (bool) –
True
if space given tochild
by theexpend
option is actually allocated tochild
, rather than just padding it. This parameter has no effect ifexpend
is set toFalse
. A child is always allocated the full height of a horizontalBox
and the full width of a verticalBox
. This option affects the other dimension. - padding (int or None) – extra space in characters to put between this child and its neighbors, over and above the global amount specified by
spacing
attribute. If child is a widget at one of the reference ends of box , then padding pixels are also put between child and the reference edge of box
Raises: - TypeError – if
child
is not a instance of LXCurses.Widget - TypeError – if
expand
is not bool type - TypeError – if
fill
is not bool type - TypeError – if
padding
is not int or None
-
reorder_child
(child, position)[source]¶ Moves
child
to a newposition
in the list ofBox
children. The list contains widgets packedPACK_START
as well as widgets packedPACK_END
, in the order that these widgets were added toBox
.A widget’s position in the
Box
children list determines where the widget is packed intoBox
. A child widget at some position in the list will be packed just after all other widgets of the same packing type that appear earlier in the list.Parameters: Raises: - TypeError – if
child
is not a GLXCurses type as tested byglxc_type()
- TypeError – if
position
is not int type - TypeError – if
child
is not a GLXCurses type as tested byglxc_type()
- TypeError – if
-
query_child_packing
(child)[source]¶ Obtains information about how child is packed into box or None if child is not found
- Return Key’s:
- widget: the Widget of the child to query expand: expand child property. fill: fill child property padding: padding child property. pack_type: pack-type child property
Parameters: child (a Galaxie Widget) – the Widget of to query Returns: information about how child is packed into box Return type: dict or None Raises: TypeError – if child
is not a GLXCurses type as tested byglxc_type()
-
set_child_packing
(child, expand, fill, padding, pack_type)[source]¶ Sets the way child is packed into box .
Parameters: Raises: - TypeError – if
child
is not bool type - TypeError – if
expand
is not bool type - TypeError – if
padding
is not int or None - TypeError – if
pack_type
is not glxc.PACK_START or glxc.PACK_END
- TypeError – if
-
set_center_widget
(widget=None)[source]¶ Sets a center widget; that is a child widget that will be centered with respect to the full width of the box, even if the children at either side take up different amounts of space.
Parameters: widget ( Widget
or None) – theWidget
of the child to setRaises: TypeError – if widget
is not a GLXCurses type as tested byglxc_type()
or None
-