GUI
GUI Components
The public GUI surface is collected by guiall.h. It is broader than a widget list:
NAppGUI exposes application-level services, layout containers, menus, common dialogs, native-backed controls,
and owner-drawn custom surfaces through one umbrella include.
Relevant Source Files
What guiall.h Actually Exposes
The umbrella header includes all of the major GUI families: buttons, edits, combos, popups, sliders,
progress bars, labels, image views, list boxes, table views, views, text views, web views, split views,
panels, layouts, menus, menu items, windows, line widgets, and the shared gui.h service API.
That means application code can often include just nappgui.h or gui/guiall.h and get the full desktop surface.
Component Taxonomy
| Family | Representative Headers | Main Role |
|---|---|---|
| Application services | gui.h |
Theme state, resource packs, device info, notifications, idle work, and generic info dialogs. |
| Primitive controls | button.h, edit.h, combo.h, popup.h, slider.h, progress.h, updown.h |
Standard form/input controls backed by the native platform backend. |
| Owner-drawn surfaces | view.h, label.h, imageview.h, listbox.h, tableview.h |
Custom drawing and event routing on top of the shared view infrastructure. |
| Rich content | textview.h, webview.h |
Formatted text editing/display and embedded browser content. |
| Containers | layout.h, cell.h, panel.h, splitview.h, window.h |
Composition, nesting, scrolling, panel switching, and top-level window behavior. |
| Menus and dialogs | menu.h, menuitem.h, comwin.h |
Menu bars, popup menus, shortcuts, and OS-native common windows. |
Shared GUI Services
gui.h is the cross-cutting API that makes the component layer feel like a framework instead of a widget bag.
It lets apps register resource packs with gui_respack(...), switch locale with gui_language(...),
resolve themed colors and dark mode, query device/workarea/mouse information, and subscribe to theme-change,
notification, or idle events.
This is also where the binding-event helpers live: evbind_object(...) and evbind_modify(...).
Native Wrappers Versus Custom Views
The component list is intentionally mixed. Buttons, edits, combos, popups, sliders, and window chrome come from
the native backend through GuiCtx and osgui. By contrast, several higher-level widgets are
implemented as custom views in the portable gui layer and drawn through draw2d.
That split is one of the key architectural patterns in the repo: the public API is unified, but the implementation deliberately uses both native controls and owner-drawn controls where that makes more sense.