3.3.2 Windows
3.3.2.1 Window
3.3.2.2 Dialog
On this page:
Window
Window.Style
Window.Style.no_  resize_  border
Window.Style.no_  title
Window.Style.no_  system_  menu
Window.Style.hide_  menu_  bar
Window.Style.float
Window.Style.fullscreen_  button
Window.Style.fullscreen_  aux

image

class

class gui.Window():

  implements WindowView

  constructor (

    ~title: title :: ObsOrValue.of(String) = "Untitled",

    ~size: size :: ObsOrValue.of(View.Size) = [#false, #false],

    ~align: align :: ObsOrValue.of(View.Alignment) = [#'center, #'center],

    ~position: position :: ObsOrValue.of(View.Position) = #'center,

    ~min_size: min_size :: ObsOrValue.of(View.Size) = [#false, #false],

    ~stretch: stretch :: ObsOrValue.of(View.Stretch) = [#true, #true],

    ~enable: enable :: ObsOrValue.of(Boolean) = #true,

    ~styles: styles :: ObsOrValue.of(List.of(Window.Style)) = [],

    ~menu_bar: menu_bar :: maybe(MenuBar) = #false,

    ~window_callbacks: window_callbacks :: maybe(WindowCallbacks) = #false,

    child :: ObsOrValue.of(WindowChildView && !WindowView), ...

  )

Creates a top-level window view that can be instantiated with render. The child views supply the window content.

A window style option:

  • #'no_resize_border: Disables window resizing by a user.

  • #'no_title: Omits a title bar for the window.

  • #'no_system_menu: Omits the system menu (Windows).

  • #'hide_menu_bar: Hides the menu bar and dock when the window is active (Mac OS) or asks the window manager to make the window fullscreen (Unix).

  • #'float: Causes the window to stay in front of all other non-floating windows. On Mac OS, a floating window shares the focus with an active non-floating window. When this style is combined with #'no_caption, then showing the frame does not cause the keyboard focus to shift to the window, and on Unix, clicking the frame does not move the focus. on Windows, a floating window has no taskbar button.

  • #'fullscreen_button: Includes a button on the window’s title bar to put the window in fullscreen mode (Mac OS 10.7 and later).

  • #'fullscreen_aux: Allows the window to accompany another that is in fullscreen mode (Mac OS 10.7 and later).