Window - Garland-g/perl6-libui GitHub Wiki

Window

Libui::Window

A window. One is created for you inside of each App.

Cannot be placed into other controls.

Methods

new(Str:D $title, Int $width = 640, Int $height = 480, Bool(Int) $has-menubar = 1)

Creates a window.

set-content(Libui::Control:D $control)

Sets the child widget of the Window.

title() returns Str

Returns the title of the Window.

set-title(Str:D $title) or title(Str:D $title)

Sets the title of the window.

content-size(int32 $width, int32 $height) or content-size($width is rw where Int ~~ *, $height is rw where Int ~~ *)

Sets the value of $width and $height to the width and height of the Window.

set-content-size(UInt $width, UInt $height)

Sets the width and height of the Window. Does nothing until the show() is run

width() returns UInt

Returns the width of the Window. Returns 1 until show() has been run.

height() returns UInt

Returns the height of the Window. Returns 1 until show() has been run.

fullscreen() returns Bool

Returns the value of the fullscreen property.

set-fullscreen(Int $fullscreen) or fullscreen(Int $fullscreen)

Sets the value of the fullscreen property.

borderless() returns Bool

Returns the value of the borderless property.

set-borderless(Bool:D(Int) $borderless) or borderless(Bool:D(Int) $borderless)

Sets the value of the borderless property.

margined() returns Bool

Returns the value of the margined property.

set-margined(Bool:D(Int) $margined) or margined(Bool:D(Int) $margined)

Sets the value of the margined property.

closing() returns Supply

Returns a Supply. An event is emitted whenever the Window is signaled to close.

size-changed returns Supply

Returns a Supply. An event is emitted whenever the Window's height or width changes.

open() returns Str

Opens a native file chooser for opening files. Returns a Str that is the path to the chosen file.

save() returns Str

Opens a native file chooser for saving files. Returns a Str that is the path to the chosen file.

msg-box(Str $title, Str $description)

Opens a message box.

msg-box-err(Str $title, Str $description)

Opens an error message box.