silk/window

wxWindow is the base class for all windows and represents any visible object on screen.

All controls, top level windows and so on are windows. Sizers and device contexts are not, however, as they don’t appear on screen themselves.

Please note that all children of the window will be deleted automatically by the destructor before the window itself is deleted which means that you don’t have to worry about deleting them manually. Please see the window deletion overview for more information.

Also note that in this, and many others, wxWidgets classes some GetXXX() methods may be overloaded (as, for example, getSize or getClientSize). In this case, the overloads are non-virtual because having multiple virtual functions with the same name results in a virtual function name hiding at the derived class level (in English, this means that the derived class has to override all overloaded variants if it overrides any of them). To allow overriding them in the derived class, wxWidgets uses a //// unique protected virtual DoGetXXX() method and all GetXXX() ones are forwarded to it, so overriding the former changes the behaviour of the latter.

Derived from WxEvtHandler

Types

pub type CloseOption {
  Force(Bool)
}

Constructors

  • Force(Bool)
pub type WxWindow(win) =
  types.WxObject(types.WxWindow(win))

Functions

pub fn cache_best_size(
  this: WxObject(WxWindow(a)),
  size: #(Int, Int),
) -> Result(Nil, Nil)

Sets the cached best size value.

pub fn can_set_transparent(this: WxObject(WxWindow(a))) -> Bool

Returns true if the system supports transparent windows and calling setTransparent/2 may succeed.

pub fn capture_mouse(
  this: WxObject(WxWindow(a)),
) -> Result(Nil, Nil)

Directs all mouse input to this window.

pub fn center(this: WxObject(WxWindow(a))) -> Result(Nil, Nil)

Equivalent to center2(this, []).

pub fn center_on_parent(
  this: WxObject(WxWindow(a)),
) -> Result(Nil, Nil)

Equivalent to: center_on_parent2(this, [])

pub fn centre(this: WxObject(WxWindow(a))) -> Result(Nil, Nil)

Centres the window.

pub fn centre_on_parent(
  this: WxObject(WxWindow(a)),
) -> Result(Nil, Nil)

Equivalent to centre_on_parent(this, []).

pub fn client_to_screen(
  this: WxObject(WxWindow(a)),
  x: b,
  y: b,
) -> #(Int, Int)

Converts to screen coordinates from coordinates relative to this window.

pub fn close(this: WxObject(WxWindow(a))) -> Bool

Equivalent to close2(This, []).

pub fn close2(
  this: WxObject(WxWindow(a)),
  options: List(CloseOption),
) -> Bool

This function simply generates a wxCloseEvent whose handler usually tries to close the window.

pub fn create(
  this: WxObject(WxWindow(a)),
  parent: WxObject(WxWindow(a)),
  id: Int,
) -> Bool
pub fn destroy(this: WxObject(WxWindow(a))) -> Result(Nil, Nil)
pub fn destroy_children(this: WxObject(WxWindow(a))) -> Bool
pub fn disable(this: WxObject(WxWindow(a))) -> Bool
pub fn fit(this: WxObject(WxWindow(a))) -> Result(Nil, Nil)
pub fn fit_inside(
  this: WxObject(WxWindow(a)),
) -> Result(Nil, Nil)
pub fn get_id(this: WxObject(WxWindow(a))) -> Int
pub fn hide(this: WxObject(WxWindow(a))) -> Result(Nil, Nil)
pub fn new() -> WxObject(WxWindow(a))
pub fn new_2(
  parent: WxObject(WxWindow(a)),
  id: Int,
) -> WxObject(WxWindow(a))
pub fn refresh(this: WxObject(WxWindow(a))) -> Result(Nil, Nil)
pub fn set_background_colour(
  this: WxObject(WxWindow(a)),
  colour: #(Int, Int, Int, Int),
) -> Bool
pub fn set_client_size(
  this: WxObject(WxWindow(a)),
  width: Int,
  height: Int,
) -> Result(Nil, Nil)
pub fn set_foreground_colour(
  this: WxObject(WxWindow(a)),
  colour: #(Int, Int, Int, Int),
) -> Result(Nil, Nil)
pub fn set_help_text(
  this: WxObject(WxWindow(a)),
  help_text: String,
) -> Result(Nil, Nil)
pub fn set_id(
  this: WxObject(WxWindow(a)),
  winid: Int,
) -> Result(Nil, Nil)
pub fn set_label(
  this: WxObject(WxWindow(a)),
  label: String,
) -> Nil
pub fn set_name(this: WxObject(WxWindow(a)), name: String) -> Nil
pub fn set_size(
  this: WxObject(WxWindow(a)),
  width: Int,
  height: Int,
) -> Result(Nil, Nil)
pub fn set_size_pos(
  this: WxObject(WxWindow(a)),
  x: Int,
  y: Int,
  width: Int,
  height: Int,
) -> Result(Nil, Nil)
pub fn set_sizer(
  this: WxObject(WxWindow(a)),
  sizer: WxSizer(b),
) -> Nil

Sets the window to have the given layout sizer.

The window will then own the object, and will take care of its deletion. If an existing layout constraints object is already owned by the window, it will be deleted if the deleteOld parameter is true.

Note that this function will also call setAutoLayout/2 implicitly with true parameter if the sizer is non-NULL and false otherwise so that the sizer will be effectively used to layout the window children whenever it is resized.

Remark: SetSizer enables and disables Layout automatically.

pub fn show(this: WxObject(WxWindow(a))) -> Bool
pub fn update(this: WxObject(WxWindow(a))) -> Result(Nil, Nil)
Search Document