wxSizerItem(3)
π wxSizerItem β bestie edition π
okay so this is the wxSizerItem(3) page, straight out of the Erlang Module Definition corner of the wx 2.6 universe (Ericsson AB's finest, we love them). sit down, grab a strawberry π, and let's get into it.
β¨ NAME β¨
wxSizerItem β the class that keeps tabs on the position, the size, and all the other lil' attributes of every single item a wxSizer is out here managing. she's the record-keeper. the group-chat admin of layout. π
πΈ DESCRIPTION πΈ
lowkey? you usually don't need to touch this class directly. sizer elements can totally be found by their positions, or by their window/sizer pointers instead. but sometimes, ngl, it's just more convenient to use it straight up. do what feels right π«Ά
wxWidgets docs: wxSizerItem
π¦ DATA TYPES π¦
wxSizerItem() :: wx:wx_object().
π FUNCTIONS π
π assignSizer(This, Sizer) -> ok
assignSizer(This, Sizer) -> ok
when
This :: wxSizerItem(),
Sizer :: wxSizer:wxSizer().
sets the sizer that this item is tracking.
heads up bestie: the old sizer, if there was one, gets deleted. gone. periodt.
π assignSpacer(This, Size) -> ok
assignSpacer(This, Size) -> ok
when
This :: wxSizerItem(),
Size :: {W :: integer(), H :: integer()}.
sets the size of the spacer this item is tracking.
and yeah β the old spacer, if any, is deleted too. same energy as above fr.
π assignSpacer(This, W, H) -> ok
assignSpacer(This, W, H) -> ok
when
This :: wxSizerItem(),
W :: integer(),
H :: integer().
π assignWindow(This, Window) -> ok
assignWindow(This, Window) -> ok
when
This :: wxSizerItem(),
Window :: wxWindow:wxWindow().
sets the window that this item will be tracking.
β οΈ Note β and I mean it, bestie: this is a low-level method and it is dangerous if you use it wrong. avoid it if you possibly can, i.e. if higher level methods like wxSizer:replace/4 can be used instead. please. for me. π
if the sizer item previously contained a window, it gets dissociated from the sizer containing this sizer item (if there is one) β but this object doesn't have the pointer to the containing sizer, so it's the caller's responsibility to call wxWindow:setContainingSizer/2 on window. not doing this can cause memory corruption when the window gets destroyed later, so it is crucial to not forget. like, crucial crucial. π
also note: the previously contained window is not deleted, so it's also the caller's responsibility to do that, if necessary.
π calcMin(This) -> {W :: integer(), H :: integer()}
calcMin(This) -> {W :: integer(), H :: integer()}
when This :: wxSizerItem().
calculates the minimum desired size for the item, including whatever space the borders need. she's doing the math β¨
π deleteWindows(This) -> ok
deleteWindows(This) -> ok when This :: wxSizerItem().
destroys the window, or the windows inside a subsizer β depends on what kind of item this is.
π destroy(This :: wxSizerItem()) -> ok
destroy(This :: wxSizerItem()) -> ok.
destroys the object π
π detachSizer(This) -> ok
detachSizer(This) -> ok when This :: wxSizerItem().
lets you delete the SizerItem without destroying the sizer it contains. the respectful breakup option π
π getBorder(This) -> integer()
getBorder(This) -> integer() when This :: wxSizerItem().
returns the border attribute.
π getFlag(This) -> integer()
getFlag(This) -> integer() when This :: wxSizerItem().
returns the flags attribute.
check the wxSizer flags list (not implemented in wx) for the deets π
π getMinSize(This) -> {W :: integer(), H :: integer()}
getMinSize(This) -> {W :: integer(), H :: integer()}
when This :: wxSizerItem().
gets the minimum size the item needs.
π getPosition(This) -> {X :: integer(), Y :: integer()}
getPosition(This) -> {X :: integer(), Y :: integer()}
when This :: wxSizerItem().
what's the current position of the item, as set in the last Layout? that's this.
π getProportion(This) -> integer()
getProportion(This) -> integer() when This :: wxSizerItem().
gets the proportion item attribute.
π getRatio(This) -> number()
getRatio(This) -> number() when This :: wxSizerItem().
gets the ratio item attribute.
π getRect(This)
getRect(This) ->
{X :: integer(),
Y :: integer(),
W :: integer(),
H :: integer()}
when This :: wxSizerItem().
gets the rectangle of the item on the parent window β borders not included, she's exclusive like that π
π getSize(This) -> {W :: integer(), H :: integer()}
getSize(This) -> {W :: integer(), H :: integer()}
when This :: wxSizerItem().
gets the current size of the item, as set in the last Layout.
π getSizer(This) -> wxSizer:wxSizer()
getSizer(This) -> wxSizer:wxSizer() when This :: wxSizerItem().
if this item is tracking a sizer, hand it over. π₯
NULL otherwise.
π getSpacer(This) -> {W :: integer(), H :: integer()}
getSpacer(This) -> {W :: integer(), H :: integer()}
when This :: wxSizerItem().
if this item is tracking a spacer, return its size.
π getUserData(This) -> wx:wx_object()
getUserData(This) -> wx:wx_object() when This :: wxSizerItem().
gets the userData item attribute.
π getWindow(This) -> wxWindow:wxWindow()
getWindow(This) -> wxWindow:wxWindow() when This :: wxSizerItem().
if this item is tracking a window, then return it. πͺ
NULL otherwise.
π isShown(This) -> boolean()
isShown(This) -> boolean() when This :: wxSizerItem().
returns true if this item is a window or a spacer and it's shown, or if this item is a sizer and not all of its elements are hidden.
in other words: for sizer items, all of the child elements have to be hidden for the sizer itself to count as hidden. all of them. no stragglers.
as an exception, if the wxRESERVE_SPACE_EVEN_IF_HIDDEN flag was used for this sizer item, then isShown/1 always returns true for it (see wxSizerFlags::ReserveSpaceEvenIfHidden() (not implemented in wx)).
π isSizer(This) -> boolean()
isSizer(This) -> boolean() when This :: wxSizerItem().
is this item a sizer? π΅οΈ
π isSpacer(This) -> boolean()
isSpacer(This) -> boolean() when This :: wxSizerItem().
is this item a spacer?
π isWindow(This) -> boolean()
isWindow(This) -> boolean() when This :: wxSizerItem().
is this item a window?
π new(Width, Height) / new(Window, Flags) / new(Window, [Option])
new(Width, Height) -> wxSizerItem()
when Width :: integer(), Height :: integer();
(Window, Flags) -> wxSizerItem()
when
Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
Flags :: wxSizerFlags:wxSizerFlags();
(Window, [Option]) -> wxSizerItem()
when
Window :: wxWindow:wxWindow() | wxSizer:wxSizer(),
Option ::
{proportion, integer()} |
{flag, integer()} |
{border, integer()} |
{userData, wx:wx_object()}.
π new(Width, Height, [Option]) -> wxSizerItem()
new(Width, Height, [Option]) -> wxSizerItem()
when
Width :: integer(),
Height :: integer(),
Option ::
{proportion, integer()} |
{flag, integer()} |
{border, integer()} |
{userData, wx:wx_object()}.
construct a sizer item for tracking a spacer π
π setBorder(This, Border) -> ok
setBorder(This, Border) -> ok
when This :: wxSizerItem(), Border :: integer().
sets the border item attribute.
π setDimension(This, Pos, Size) -> ok
setDimension(This, Pos, Size) -> ok
when
This :: wxSizerItem(),
Pos :: {X :: integer(), Y :: integer()},
Size :: {W :: integer(), H :: integer()}.
sets the position and size of the space allocated to the sizer, and adjusts the position and size of the item so it lives within that space β taking alignment and borders into account. very considerate of her β¨
π setFlag(This, Flag) -> ok
setFlag(This, Flag) -> ok
when This :: wxSizerItem(), Flag :: integer().
sets the flag item attribute.
π setInitSize(This, X, Y) -> ok
setInitSize(This, X, Y) -> ok
when
This :: wxSizerItem(),
X :: integer(),
Y :: integer().
sets the minimum size to be allocated for this item.
this is identical to setMinSize/3, so prefer to use the other function β its name is more clear. iykyk. π
π setMinSize(This, Size) -> ok
setMinSize(This, Size) -> ok
when
This :: wxSizerItem(),
Size :: {W :: integer(), H :: integer()}.
sets the minimum size to be allocated for this item.
if this item is a window, the size is also passed to wxWindow:setMinSize/2.
π setMinSize(This, X, Y) -> ok
setMinSize(This, X, Y) -> ok
when
This :: wxSizerItem(),
X :: integer(),
Y :: integer().
this is an overloaded member function, provided for convenience. it differs from the above function only in what argument(s) it accepts.
π setProportion(This, Proportion) -> ok
setProportion(This, Proportion) -> ok
when
This :: wxSizerItem(),
Proportion :: integer().
sets the proportion item attribute.
π setRatio(This, Ratio) / setRatio(This, Size)
setRatio(This, Ratio) -> ok
when This :: wxSizerItem(), Ratio :: number();
(This, Size) -> ok
when
This :: wxSizerItem(),
Size :: {W :: integer(), H :: integer()}.
π setRatio(This, Width, Height) -> ok
setRatio(This, Width, Height) -> ok
when
This :: wxSizerItem(),
Width :: integer(),
Height :: integer().
sets the ratio item attribute.
π show(This, Show) -> ok
show(This, Show) -> ok
when This :: wxSizerItem(), Show :: boolean().
sets the show item attribute, which sizers use to figure out whether the item gets to be part of the layout or not.
if the item is tracking a window, then it's shown or hidden as needed. main character energy only when she's shown π β¨
okay that's the whole page, no skips, no edits, every flag and function accounted for π
and for the cute sign-off: this masterpiece is brought to you by Ericsson AB, from wx 2.6, and it's the wxSizerItem(3) page β go build something iconic with it, bestie. ππ¦π
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms