HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions
hi::v1::default_async_delegate< ResultType > Class Template Reference

#include <hikogui/widgets/async_delegate.hpp>

Inheritance diagram for hi::v1::default_async_delegate< ResultType >:
hi::v1::async_delegate

Public Types

using result_type = ResultType
 

Public Member Functions

template<typename Func , typename... Args>
 default_async_delegate (Func &&func, Args &&... args) noexcept
 Construct a delegate.
 
- Public Member Functions inherited from hi::v1::async_delegate
virtual void init (widget_intf const &sender) noexcept
 
virtual void deinit (widget_intf const &sender) noexcept
 
template<forward_of< void()> Func>
callback< void()> subscribe (Func &&func, callback_flags flags=callback_flags::synchronous) noexcept
 Subscribe a callback for notifying the widget of a data change.
 

Detailed Description

template<typename ResultType = void>
class hi::v1::default_async_delegate< ResultType >

A default async button delegate.

The default async button delegate manages the state of a button widget using observer values.

Template Parameters
TraitsThe traits of the arguments passed to the constructor.

Constructor & Destructor Documentation

◆ default_async_delegate()

template<typename ResultType = void>
template<typename Func , typename... Args>
hi::v1::default_async_delegate< ResultType >::default_async_delegate ( Func && func,
Args &&... args )
inlinenoexcept

Construct a delegate.

Note
The function may accept a std::stop_token as a last argument, this stop-token is passed automatically when the button is pressed and the stop_token must not be passed as an argument to this constructor.
Parameters
funcThe function to be called when the button is pressed
args...The arguments passed to the function

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