package stk

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Class Window.windowSource

A window is a Layers.layers widget, 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. Even though a window is a specialized Layers.layers widget, only the first layer should be used by application's code, through the #set_child and #remove_child methods of window. Additional layers are used internally for features like inpsecting.

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 title : string

Get 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 set_child : Stk.Widget.widget -> unit
method remove_child : unit
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).

OCaml

Innovation. Community. Security.