Window
This is the fundamental widgets that serves as the main window of any application. It provies a framework for building the main user interface of an application, typically containing menu bars, toolbars, and a layout where other widgets are placed.
local window = Window{title = 'Limekit', icon = images('app.png'), size={200,200}}
window:show()
Important
You should first set a layout to hold all of your widgets.
Properties
- setOnShown(callback)
Executed whenever the window is shown or displayed on the screen.
- setOnClose(callback)
Executed when the window is closing.
- setOnResize(callback)
Executed whenever the window is being resized.
- maximize()
Used to enlarge a window to fill the entire screen. It allows the window to occupy the maximum available space on the screen
- minimize()
Minimizes or iconifies a window to the system taskbar or dock. It shrinks the window and places an icon representing the window in the taskbar or dock, allowing users to easily restore the window later
- setMinSize(width, height)
Sets the minimum size
- setMaxHeight(height)
Sets the maximum height
- setMinHeight(height)
Sets the minimum height
- setMaxWidth(width)
Sets the maximum width
- setMinWidth(width)
Sets the minimum width
- setMaxSize(width, height)
Sets the maximum size
- setCustomCursor(path)
Sets a custom cursor icon from path for the window
- setTitle(title)
Sets the title for the window
- setMainWidget(widget)
Sets any widget as the central widget, causing it to take up the available space.
- setSize(width, height)
Sets the size of the window
- setLayout(layout)
Sets a primary layout for the window
- addDock(dock, area: optional)
Adds a dock to the window.
Areas available:
left
,right
,top
,bottom
,allareas
andnodock
checkout Docks
- setIcon(path)
Sets the icon for the window
- addToolbar(toolbar)
Adds a toolbar to the window
checkout Tool bars
- setMenubar(menubar)
Sets a menubar for the window
checkout Menu bars
Note
There can only be one menubar per window
- center()
Centers the window
- setFixedSize(width, height)
Sets a fixed size to restrict resizing the window
- show()
Shows the window