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

Public Types

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

Public Member Functions

virtual void init (selection_widget &sender) noexcept
 
virtual void deinit (selection_widget &sender) noexcept
 
virtual callback_ptr_type subscribe (selection_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 (selection_widget &sender, Callback &&callback) noexcept
 Subscribe a callback for notifying the widget of a data change.
 
virtual void unsubscribe (selection_widget &sender, callback_ptr_type const &callback) noexcept
 Unsubscribe a callback.
 
virtual void set_selected (selection_widget &sender, ssize_t index) noexcept
 Called when an option is selected by the user.
 
virtual std::pair< std::vector< label >, ssize_toptions_and_selected (selection_widget const &sender) const noexcept
 Retrieve the label of an option.
 

Member Function Documentation

◆ options_and_selected()

virtual std::pair< std::vector< label >, ssize_t > tt::selection_delegate::options_and_selected ( selection_widget const & sender) const
inlinevirtualnoexcept

Retrieve the label of an option.

Reimplemented in tt::default_selection_delegate< T >.

◆ set_selected()

virtual void tt::selection_delegate::set_selected ( selection_widget & sender,
ssize_t index )
inlinevirtualnoexcept

Called when an option is selected by the user.

Parameters
indexThe index of the option selected, -1 if no option is selected.

Reimplemented in tt::default_selection_delegate< T >.

◆ subscribe() [1/2]

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

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

◆ subscribe() [2/2]

virtual callback_ptr_type tt::selection_delegate::subscribe ( selection_widget & sender,
callback_ptr_type const & callback )
inlinevirtualnoexcept

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

Reimplemented in tt::default_selection_delegate< T >.

◆ unsubscribe()

virtual void tt::selection_delegate::unsubscribe ( selection_widget & sender,
callback_ptr_type const & callback )
inlinevirtualnoexcept

Unsubscribe a callback.

Reimplemented in tt::default_selection_delegate< T >.


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