Box¶
A userdata which corresponds to the mounted version of
BoxProps
A native component within
hitokage
that can hold other components.
Notably, it also has an extended userdata:
This userdata can be retrieved using:
Example
Attributes:
Methods:
- get_child_by_id
- get_children
- get_class
- get_halign
- get_height
- get_height_request
- get_hexpand
- get_homogeneous
- get_size_request
- get_type
- get_valign
- get_vexpand
- get_widget_by_id
- get_widgets
- get_width
- get_width_request
- set_class
- set_halign
- set_height_request
- set_hexpand
- set_homogeneous
- set_size_request
- set_valign
- set_vexpand
- set_width_request
attr
type¶
Type: 'Box'
method
get_child_by_id¶
Gets the first item in the widget tree that has the identifier.
When recursive
is set to true
the search is performed breadth-first,
then in order of components on the tree.
Parameters:
Returns:
method
get_children¶
method
get_class¶
method
get_halign¶
method
get_height¶
Returns the content height of the widget.
To learn more about widget sizes, see the coordinate system overview.
Returns:
method
get_height_request¶
Gets the height request that was explicitly set for the widget using set_height_request
or set_size_request
.
A value of -1
stored in height indicates that it has not been set explicitly and the natural requisition of the widget will be used instead.
To get the height a widget will actually request, call measure_height
instead of this function.
See also: get_width_request
, get_size_request
.
Returns:
method
get_hexpand¶
Gets whether the widget would like any available extra horizontal space.
Returns:
method
get_homogeneous¶
Returns whether the box is homogeneous (all children are the same size).
Returns:
method
get_size_request¶
Gets the size request that was explicitly set for the widget using set_size_request
.
A value of -1
stored in width or height indicates that that dimension has not been set explicitly and the natural requisition of the widget will be used instead.
To get the size a widget will actually request, call measure
instead of this function.
See also: get_width_request
, get_height_request
.
Returns:
[integer, integer]
method
get_type¶
method
get_valign¶
method
get_vexpand¶
Gets whether the widget would like any available extra vertical space.
Returns:
method
get_widget_by_id¶
Deprecated
Use get_child_by_id
instead.
Gets the first item in the widget tree that has the identifier.
When recursive
is set to true
the search is performed breadth-first,
then in order of components on the tree.
Parameters:
Returns:
method
get_widgets¶
method
get_width¶
Returns the content width of the widget.
To learn more about widget sizes, see the coordinate system overview.
Returns:
method
get_width_request¶
Gets the width request that was explicitly set for the widget using set_width_request
or set_size_request
.
A value of -1
stored in width indicates that it has not been set explicitly and the natural requisition of the widget will be used instead.
To get the width a widget will actually request, call measure_width
instead of this function.
See also: get_height_request
, get_size_request
.
Returns:
method
set_class¶
method
set_halign¶
Sets the horizontal alignment of widget
.
Parameters:
-
(halign
¶'Baseline'|'Center'|'End'|'Fill'|'Start'...(+1)
)
Returns:
method
set_height_request¶
Sets the minimum height of a widget.
That is, the widget’s size request will be at least height
. You can use this function to force a widget to be taller than it normally would be.
If the height request in a given direction is -1
(unset), then the “natural” height request of the widget will be used instead.
See also: set_width_request
, set_size_request
.
Parameters:
Returns:
method
set_hexpand¶
Sets whether the widget would like any available extra horizontal space.
Parameters:
Returns:
method
set_homogeneous¶
Sets whether or not all children of box
are given equal space in the box.
Parameters:
Returns:
method
set_size_request¶
Sets the minimum size of a widget.
That is, the widget’s size request will be at least width
by height
. You can use this function to force a widget to be larger than it normally would be.
If the size request in a given direction is -1
(unset), then the “natural” size request of the widget will be used instead.
See also: set_width_request
, set_height_request
.
Parameters:
-
(size
¶[integer?, integer?]
)
Returns:
method
set_valign¶
Sets the vertical alignment of widget
.
Parameters:
-
(valign
¶'Baseline'|'Center'|'End'|'Fill'|'Start'...(+1)
)
Returns:
method
set_vexpand¶
Sets whether the widget would like any available extra vertical space.
Parameters:
Returns:
method
set_width_request¶
Sets the minimum width of a widget.
That is, the widget’s size request will be at least width
. You can use this function to force a widget to be wider than it normally would be.
If the width request in a given direction is -1
(unset), then the “natural” width request of the widget will be used instead.
See also: set_height_request
, set_size_request
.
Parameters:
Returns: