Class Button#

Inheritance Relationships#

Base Type#

Class Documentation#

class Button : public Karana::WebUI::Widget#

Widget displaying a button triggering a server-side callback.

Public Functions

Button(Router &router, std::string_view text, std::function<void()> on_press = {})#

Button constructor.

Parameters:
  • router – The connection router to use

  • text – The text displayed in the button

  • on_press – Called when the button is pressed

virtual ~Button()#

Button destructor.

Protected Functions

virtual void _onMessage(std::string_view message, int client_id) override#

Called upon a message from a client.

This can be overridden to implement custom behavior.

Parameters:
  • message – The message from the client

  • client_id – Unique id for the client