HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions
tt::button_delegate Class Reference
Inheritance diagram for tt::button_delegate:
tt::default_button_delegate< ButtonType, T >

Public Types

using callback_ptr_type = std::shared_ptr<std::function<void()>>
 

Public Member Functions

virtual void init (abstract_button_widget &sender) noexcept
 
virtual void deinit (abstract_button_widget &sender) noexcept
 
virtual callback_ptr_type subscribe (abstract_button_widget &sender, callback_ptr_type const &callback) noexcept
 Subscribe a callback for notifying the widget of a data change.
 
template<typename Callback >
requires (std::is_invocable_v<Callback>)
callback_ptr_type subscribe (abstract_button_widget &sender, Callback &&callback) noexcept
 Subscribe a callback for notifying the widget of a data change.
 
virtual void unsubscribe (abstract_button_widget &sender, callback_ptr_type const &callback) noexcept
 Unsubscribe a callback.
 
virtual void activate (abstract_button_widget &sender) noexcept
 Called when the button is pressed by the user.
 
virtual button_state state (abstract_button_widget const &sender) const noexcept
 Used by the widget to check the state of the button.
 

Member Function Documentation

◆ activate()

virtual void tt::button_delegate::activate ( abstract_button_widget & sender)
inlinevirtualnoexcept

Called when the button is pressed by the user.

◆ state()

virtual button_state tt::button_delegate::state ( abstract_button_widget const & sender) const
inlinevirtualnoexcept

Used by the widget to check the state of the button.

◆ subscribe() [1/2]

template<typename Callback >
requires (std::is_invocable_v<Callback>)
callback_ptr_type tt::button_delegate::subscribe ( abstract_button_widget & sender,
Callback && callback )
inlinenoexcept

Subscribe a callback for notifying the widget of a data change.

◆ subscribe() [2/2]

virtual callback_ptr_type tt::button_delegate::subscribe ( abstract_button_widget & sender,
callback_ptr_type const & callback )
inlinevirtualnoexcept

Subscribe a callback for notifying the widget of a data change.

◆ unsubscribe()

virtual void tt::button_delegate::unsubscribe ( abstract_button_widget & sender,
callback_ptr_type const & callback )
inlinevirtualnoexcept

Unsubscribe a callback.


The documentation for this class was generated from the following file: