Class Window.window

A window is a widget containing one widget and interfacing with SDL window to render and handle events. Windows should not be created directly but through App.create_window, App.create_scrolled_window and App.popup_menu so that events are propagated to them

inherit Stk.Bin.bin
method window : Tsdl.Sdl.window

The SDL window.

method window_id : int

The SDL window id.

method set_title : string -> unit

Set window title.

method position : int * int

Returns SDL window position as (x,y).

method size : int * int

Returns the SDL window size.

method resize : w:int -> h:int -> unit

w#resize ~w ~h resize the window with width w and height h.

method set_on_close : (unit -> unit) -> unit

Set callback on closing.

method close : unit

Closes the window (destroying it).

method show : unit

Show SDL window.

method hide : unit

Hide SDL window.

method move : x:int -> y:int -> unit

w#move ~x ~y moves SDL window to (x,y).