Methods marked with this are available from scripts if added to the arsd.script engine.
A combination of free entry with a list below it.
A button with a consistent size, suitable for user commands like OK and Cancel.
A dialog is a transient window that intends to get information from the user before being dismissed.
A drop-down list where the user must select one of the given options. Like <select> in HTML.
Contains the implementation of text editing
FixedPosition is like StaticPosition, but its coordinates are always relative to the viewport, meaning they do not scroll with the parent content.
A text box with a drop down arrow listing selections. The user can choose from the list, or type their own.
Stacks the widgets horizontally, taking all the available height for each child.
Draws a line
Adds empty space to a layout.
Displays an in-progress indicator without known values
Makes all children minimum width and height, placing them down left to right, top to bottom.
A mouse tracking widget is one that follows the mouse when dragged inside it.
Nests an opengl capable window inside this window as a widget.
A page widget is basically a tab widget with hidden tabs.
A progress bar with a known endpoint and completion amount
A widget that takes your widget, puts scroll bars around it, and sends messages to it when the user scrolls. Unlike ScrollableWidget, it makes no effort to automatically scroll or clip its child widgets - it just sends the messages.
FIXME ScrollBarShowPolicy FIXME: use the ScrollMessageWidget in here now that it exists
Bypasses automatic layout for its children, using manual positioning and sizing only. While you need to manually position them, you must ensure they are inside the StaticLayout's bounding box to avoid undefined behavior.
Bypasses automatic positioning when being laid out. It is your responsibility to make room for this widget in the parent layout.
Status bars appear at the bottom of a MainWindow. They are made out of Parts, with a width and content.
A tab widget is a set of clickable tab buttons followed by a content area.
Toolbars are lists of buttons (typically icons) that appear under the menu. Each button ought to correspond to a menu item.
Stacks the widgets vertically, taking all the available width for each child.
Draws a line
Adds empty space to a layout.
The way this module works is it builds on top of a SimpleWindow from simpledisplay to provide simple controls and such.
Identifies the button the user pressed on a message box.
For ScrollableWidget, determines when to show the scroll bar to the user.
Creates a dialog based on a data structure.
Displays a modal message box, blocking until the user dismisses it.
Observes and allows inspection of an object via automatic gui
Program-wide keyboard shortcut to trigger the action
Group: generating_from_code
Group: generating_from_code
Group: generating_from_code
tells which menu the action will be on
This item in the menu will be preceded by a separator line
Group: generating_from_code
Describes which toolbar section the action appears on
FOR BEST RESULTS: be sure to link with the appropriate subsystem command -L/SUBSYSTEM:WINDOWS:5.0, for example, because otherwise you'll get a console and other visual bugs.
<input type="text"> = LineEdit <textarea> = TextEdit <select> = DropDownSelection <input type="checkbox"> = Checkbox <input type="radio"> = Radiobox <button> = Button
Stretchiness: The default is 4. You can use larger numbers for things that should consume a lot of space, and lower numbers for ones that are better at smaller sizes.
COMING SOON: minigui will include a little bit of I/O functionality that just works with the event loop. If you want to get fancy, I suggest spinning up another thread and posting events back and forth.
If you use arsd.minigui_xml, you can create widget trees from XML at runtime.
minigui is compatible with arsd.script. If you see @scriptable on a method in this documentation, it means you can call it from the script language.
Tip: to allow easy creation of widget trees from script, import arsd.minigui_xml and make arsd.minigui_xml.makeWidgetFromString available to your script:
import arsd.minigui_xml; import arsd.script; var globals = var.emptyObject; globals.makeWidgetFromString = &makeWidgetFromString; // this now works interpret(`var window = makeWidgetFromString("<MainWindow />");`, globals);
More to come.
minigui is a smallish GUI widget library, aiming to be on par with at least HTML4 forms and a few other expected gui components. It uses native controls on Windows and does its own thing on Linux (Mac is not currently supported but may be later, and should use native controls) to keep size down. The Linux appearance is similar to Windows 95 and avoids using images to maintain network efficiency on remote X connections, though you can customize that.
minigui's only required dependencies are arsd.simpledisplay and arsd.color.
Its #1 goal is to be useful without being large and complicated like GTK and Qt. It isn't hugely concerned with appearance - on Windows, it just uses the native controls and native theme, and on Linux, it keeps it simple and I may change that at any time.
I love Qt, if you want something full featured, use it! But if you want something you can just drop into a small project and expect the basics to work without outside dependencies, hopefully minigui will work for you.
The event model is similar to what you use in the browser with Javascript and the layout engine tries to automatically fit things in, similar to a css flexbox.