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.
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.
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
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 +/ /// Group: generating_from_cod
Program-wide keyboard shortcut to trigger the action
tells which menu the action will be on
This item in the menu will be preceded by a separator line
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.
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.
1 import arsd.minigui_xml; 2 import arsd.script; 3 4 var globals = var.emptyObject; 5 globals.makeWidgetFromString = &makeWidgetFromString; 6 7 // this now works 8 interpret(`var window = makeWidgetFromString("<MainWindow />");`, globals);
More to come.