MainWindow

A MainWindow is a window that includes turnkey support for a menu bar, tool bar, and status bar automatically positioned around a client area where you put your widgets.

Constructors

this
this(string title, int initialWidth, int initialHeight)

Members

Functions

menuBar
MenuBar menuBar()
menuBar
MenuBar menuBar(MenuBar m)
setMenuAndToolbarFromAnnotatedCode
void setMenuAndToolbarFromAnnotatedCode(T t)

Adds a menu and toolbar from annotated functions. It uses the top-level annotations from this module, so it is better to put the commands in a separate struct instad of in your window subclass, to avoid potential conflicts with method names (if you do hit one though, you can use @(.icon(...)) instead of plain @icon(...) to disambiguate, though).

toolBar
ToolBar toolBar()
toolBar
ToolBar toolBar(ToolBar t)

Properties

clientArea
Widget clientArea [@property getter]
statusBar
StatusBar statusBar [@property getter]
StatusBar statusBar [@property setter]

Returns the window's StatusBar. Be warned it may be null.

Inherited Members

From Window

icon
MemoryImage icon [@property setter]

Sets the window icon which is often seen in title bars and taskbars.

focused
bool focused [@property getter]
lineHeight
deprecated int lineHeight()

Gives the height of a line according to the default font. You should try to use your computed font instead of this, but until May 8, 2021, this was the only real option.

win
SimpleWindow win [@property getter]

Provides access to the underlying SimpleWindow. Note that changing properties on this window may disconnect minigui's event dispatchers.

win
SimpleWindow win [@property setter]
title
string title [@property getter]
title
string title [@property setter]
close
void close()
loop
void loop(BlockingMode bm)

Shows the window and runs the application event loop.

Suggestion Box / Bug Report