Documentation Index
Fetch the complete documentation index at: https://mintlify.com/The-Young-Maker/OpenMenuOS/llms.txt
Use this file to discover all available pages before exploring further.
PopupManager is a fully static class that drives the popup system in OpenMenuOS. Because every method is static you never instantiate it — you call PopupManager::showInfo(...) directly. Popups are non-blocking: a show* call renders the overlay immediately, and your loop() must call PopupManager::update() on every iteration to process user input and return the final result.
Static methods
show()
Display a popup built from aPopupConfig struct. Use this when the convenience wrappers below do not cover your needs — for example when you want auto-close on a warning, a custom color, or a custom icon.
showInfo()
Show a blue informational popup. The default title is"Information" when title is nullptr.
showSuccess()
Show a green success popup. Auto-closes after approximately 3 seconds by default. The default title is"Success".
showWarning()
Show an orange warning popup. Requires manual dismissal. The default title is"Warning".
showError()
Show a red error popup. Requires manual dismissal. The default title is"Error".
showQuestion()
Show a cyan question popup with Yes/No buttons. ReturnsPopupResult::OK when the user confirms and PopupResult::CANCEL when they decline. The default title is "Question".
update()
Process input and refresh the active popup. Must be called on everyloop() iteration. Returns PopupResult::NONE while the popup is still open, and PopupResult::OK or PopupResult::CANCEL the moment the user dismisses it (or when auto-close fires).
hide()
Programmatically dismiss the currently active popup without waiting for user input.isActive()
Returnstrue when a popup is currently visible on screen.
Non-blocking pattern
Allshow* methods render the popup overlay immediately and return PopupResult::NONE. The actual result (OK, CANCEL) only becomes available through PopupManager::update() in your main loop. This means your sketch continues to run — you must poll update() to learn when the user acted.
The recommended loop structure:
menu.loop() is intentionally called even while a popup is visible. PopupManager blocks input from reaching the underlying menu automatically. If you prefer to skip menu processing while a popup is active, guard it with if (!PopupManager::isActive()) { menu.loop(); }.Convenience method examples
- showInfo
- showSuccess
- showWarning
- showError
- showQuestion
PopupConfig struct
PopupConfig gives you full control over every aspect of a popup. Pass a configured instance to PopupManager::show().
Main body text displayed in the popup. Supports automatic word wrapping for long strings. This field must not be
nullptr.Title text shown in the popup header. When
nullptr, a type-specific default is used: "Information", "Success", "Warning", "Error", or "Question".Controls the color scheme and default icon. One of
PopupType::INFO, PopupType::SUCCESS, PopupType::WARNING, PopupType::ERROR, or PopupType::QUESTION. See Popup types and visual styles for details on each value.When
true, action buttons (OK, or Yes/No for QUESTION) are rendered at the bottom of the popup.When
true, a Cancel/No button is shown alongside the OK button. This is set automatically for PopupType::QUESTION; you can also set it on other types to create a confirmation dialog.When
true, the popup dismisses itself after autoCloseDelay milliseconds. PopupType::SUCCESS uses auto-close by default via showSuccess().Milliseconds to wait before auto-closing. Only relevant when
autoClose is true.RGB565 color value for the popup header. When
0, the color defined by the type is used.Pointer to raw RGB565 image data to use as the popup icon instead of the built-in type icon. Set to
nullptr to use the default icon for the chosen type.Width in pixels of the
customIcon image.Height in pixels of the
customIcon image.Question dialog pattern
TheshowQuestion() convenience method (and any PopupConfig with showCancelButton = true) gives the user a Yes/No choice. Because PopupManager is non-blocking, the decision arrives through update() on a later loop iteration — not as an immediate return value from the show* call.