silk/sizer

Types

pub type AddOption {
  Proportion(Int)
  Flag(Int)
  Border(Int)
}

Constructors

  • Proportion(Int)
  • Flag(Int)
  • Border(Int)
pub type ClearOption {
  DeleteWindows(Bool)
}

Constructors

  • DeleteWindows(Bool)
pub type StretchOption {
  Prop(Int)
}

Constructors

  • Prop(Int)
pub type WxSizer(t) =
  types.WxSizer(t)

Functions

pub fn add(
  this: WxSizer(a),
  window: WxObject(WxWindow(b)),
) -> WxSizerItem

Appends a child to the sizer.

pub fn add3(
  this: WxSizer(a),
  window: WxObject(WxWindow(b)),
  option: List(AddOption),
) -> OkT
pub fn add4(
  this: WxSizer(a),
  width: Int,
  height: Int,
  option: List(AddOption),
) -> OkT
pub fn add_spacer(this: WxSizer(a), size: Int) -> WxSizerItem

This base function adds non-stretchable space to both the horizontal and vertical orientation of the sizer.

pub fn add_stretch_spacer(this: WxSizer(a)) -> WxSizerItem
pub fn add_stretch_spacer2(
  this: WxSizer(a),
  option: List(StretchOption),
) -> WxSizerItem

Adds stretchable space to the sizer.

pub fn calc_min(this: WxSizer(a)) -> #(Int, Int)

This method is abstract and has to be overwritten by any derived class.

Here, the sizer will do the actual calculation of its children’s minimal sizes.

pub fn clear(this: WxSizer(a)) -> OkT

Equivalent to clear2(this, []).

pub fn clear2(this: WxSizer(a), option: ClearOption) -> OkT

Detaches all children from the sizer.

If delete_windows is true then child windows will also be deleted.

Notice that child sizers are always deleted, as a general consequence of the principle that sizers own their sizer children, but don’t own their window children (because they are already owned by their parent windows).

pub fn detach(
  this: WxSizer(a),
  window: WxObject(WxWindow(b)),
) -> Bool

Detach a item at position index from the sizer without destroying it.

This method does not cause any layout or resizing to take place, call layout to update the layout “on screen” after detaching a child from the sizer. Returns true if the child item was found and detached, false otherwise.

pub fn fit(
  this: WxSizer(a),
  window: WxObject(WxWindow(b)),
) -> #(Int, Int)

Tell the sizer to resize the window so that its client area matches the sizer’s minimal size (ComputeFittingClientSize() (not implemented in wx) is called to determine it).

This is commonly done in the constructor of the window itself, see sample in the description of wxBoxSizer.

Return: The new window size.

Search Document