Button

Native button, can also be used as checkbox and radio button.

Header#include "nativeui/button.h"
Namespacenamespace nu
Typeclass (RefCounted)
InheritsView

Constructors

Button(const std::string& title, Button::Type type)

Create a new button.

Parameters

Class properties

const char* kClassName

The class name of this view.

Methods

void SetTitle(const std::string& title)

Set button title.

Parameters

std::string GetTitle() const

Return the button title.

Return

std::string

void SetChecked(bool checked)

Set checked state of checkbox or radio.

Parameters

bool IsChecked() const

Return whether checkbox or radio is checked.

Return

bool

Events

void on_click(Button* self)

Emitted when button is clicked.

Parameters

Preventable

No.