public abstract class Window extends Widget
Base class for graphical windows.
size, width, height and placement dimensions describe the complete visible window, including its title bar and borders. clientSize describes the usable area inside that frame, before menu bars and content margins. There is no implicit content padding. Native frame metrics become definitive when the operating system has created and decorated the window.
A window is centered on its screen by default the first time it is shown. setPlacement() can restore explicit screen bounds and maximized mode. Call centerIn() explicitly when you need to recenter it after changing its requested size before display.
win = MainWindow("Demo")
win.size = (900, 600)
win.show() # centered by default| Modifier and Type | Member | Description |
|---|---|---|
| public property | appearanceModeappearanceMode as String |
Appearance mode: system, light or dark. |
| public readonly property | clientHeightclientHeight as Int |
Height available inside the window frame, before menu bars or margins. |
| public readonly property | clientSize | Read-only dimensions inside the frame as (width, height). |
| public readonly property | clientWidthclientWidth as Int |
Width available inside the window frame, before menu bars or margins. |
| public readonly property | focusedWidgetfocusedWidget as Widget = null |
Current keyboard target, or null when no widget owns keyboard focus. |
| public property | frameframe as WindowFrame |
Window frame mode. |
| public property | iconicon as Icon |
Application icon displayed by the window manager and native title bar. |
| public override property | isVisibleisVisible as Boolean |
Native window visibility, without an explicit foreground activation request. |
| public property | titletitle as String |
Window title. |
| Modifier and Type | Member | Description |
|---|---|---|
| public event | closedclosed as CloseEvent |
Event emitted when the native window is closed. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | adjustContentZoom | Adjusts the runtime content zoom for all GUI windows. |
| public | adjustFontZoom | Backward-compatible alias for adjustContentZoom. |
| public | applyContentZoomapplyContentZoom() as Void |
Applies the current runtime content zoom without reloading the KSS tree. |
| public | applyLayoutapplyLayout() as Void |
Synchronizes window bounds with the requested size. |
| public native | applyNativeFrameapplyNativeFrame() as Void |
Applies the current frame value to the native window if it already exists. |
| public | applyThemeapplyTheme(mode as String = null) as Void |
Applies a new appearance mode to this window and requests a repaint. |
| public | capturecapture(path as Path) as Void throws IOException |
Captures the current window client area into a BMP image. |
| public native | capturecapture(filename as String) as Void throws IOException |
Captures the current window client area into a BMP image. |
| public native | centerIncenterIn(container as Container = null) as Void |
Centers the window on its screen. |
| public native | closeclose() as Void |
Closes the window. |
| public native | copyToClipboard | Copies plain text to the operating-system clipboard. |
| public | emitClosedemitClosed() as Void |
Native backend hook that emits the close notification. |
| public | getPlacementgetPlacement() as WindowPlacement |
Reads normal screen bounds and the normal/maximized display mode. |
| public | maximizemaximize() as Void |
Maximizes while keeping the normal bounds and frame. |
| public native | readFromClipboardreadFromClipboard() as String |
Reads plain text from the operating-system clipboard. |
| public | relayoutrelayout() as Void |
Replays the window layout using the current bounds. |
| public | renderrender(painter as Painter) as Void |
Native-facing rendering hook. |
| public override native | repaintrepaint() as Void |
Repaints the native window client area without forcing a relayout. |
| public native | repaintWidgetrepaintWidget(widget as Widget) as Void |
Repaints a single widget when the backend can safely do it. |
| public | resetContentZoomresetContentZoom() as Boolean |
Resets the runtime content zoom and native window size. |
| public | resetFontZoomresetFontZoom() as Boolean |
Backward-compatible alias for resetContentZoom. |
| public | restorerestore() as Void |
Returns to normal mode, retaining restoration dimensions and position. |
| public native | runrun() as Int |
Shows the window and starts its native event loop until it is closed. |
| public override | setBounds | Updates the logical bounds and, when created, the complete native size. |
| public native | setPlacementsetPlacement(placement as WindowPlacement) as Void |
Restores geometry and mode without changing the selected frame. |
| public native | showshow() as Void |
Shows the window and asks the operating system to place it in the foreground with keyboard focus. |
| public native | simulateFilesDropped | Simulates a file drop using native target routing, including modal overlays. |
| public | simulateMouseClick | Simulates a full native mouse click. |
| public native | simulateMousePressed | Simulates a native mouse press routed through the window hit-testing pipeline. |
| public native | simulateMouseReleased | Simulates a native mouse release routed through the window hit-testing pipeline. |
| public native | syncContentZoomSize | Synchronizes the native client size with the current content zoom. |
| public | themetheme() as KssTheme |
Returns the active KSS theme for this window. |