App
Application class.
Header | #include "nativeui/app.h" |
Namespace | namespace nu |
Type | class |
This class represents current app and provides app wide APIs.
This class can not be created by user, you must create State
first and
then receive an instance of App
via App::GetCurrent
.
nu::State state;
nu::App* app = nu::App::GetCurrent();
Class methods
App* GetCurrent()
Return current app.
Return
App*
Methods
macOS
void SetApplicationMenu(MenuBar* menu)Set the application menu bar.
Parameters
MenuBar*
menu
macOS
MenuBar* GetApplicationMenu() constReturn the application menu bar.
Return
MenuBar*
macOS
void SetDockBadgeLabel(const std::string& label)Set the label
to be displayed in dock’s badging area.
Parameters
const std::string&
label
macOS
std::string GetDockBadgeLabel() constGet the label displayed in dock’s badging area.
Return
std::string
Color GetColor(App::ThemeColor name)
Return color of a theme component.
Parameters
App::ThemeColor
name
Return
Color
Font* GetDefaultFont()
Return the default font for displaying text.
Return
Font*
Clipboard* GetClipboard(Clipboard::Type type)
Return the clipboard with type
.
The returned clipboard instance is managed by App, there is no need to manually free it.
The CopyPaste
clipboard will be return if The type
argument is
omitted.
Parameters
Clipboard::Type
type
Return
Clipboard*