Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::ui::DynamicRef Class Reference

Dynamic named observation with checked caption/editor and Button capabilities. Copies own the request name and observing slot; they never retain a scene/widget. Converting to Ref<T> checks the same published NodeId, or waits for this slot before mount. More...

#include <ui_ref.hpp>

Public Member Functions

template<class T>
requires std::derived_from<T, Widget>
 operator Ref< T > () const
TextProperty text (TextResolver resolver={}, std::source_location origin=std::source_location::current()) const
template<class Callback = detail::QuitCommand>
requires portals::detail::ManagedAction<Callback, ClickEvent>
std::expected< void, ManagedError > onClick (Callback callback, std::source_location origin=std::source_location::current()) const
Node< Widget > node () const noexcept

Friends

class Scene
struct detail::NamedAccess

Detailed Description

Dynamic named observation with checked caption/editor and Button capabilities. Copies own the request name and observing slot; they never retain a scene/widget. Converting to Ref<T> checks the same published NodeId, or waits for this slot before mount.

Member Function Documentation

◆ node()

Node< Widget > portals::ui::DynamicRef::node ( ) const
inlinenoexcept
Returns
Observing published identity, empty before mount; UI-thread only.

◆ onClick()

template<class Callback = detail::QuitCommand>
requires portals::detail::ManagedAction<Callback, ClickEvent>
std::expected< void, ManagedError > portals::ui::DynamicRef::onClick ( Callback callback,
std::source_location origin = std::source_location::current() ) const
inline
Template Parameters
CallbackOwning compact Button action accepted by Ref<Button>::onClick.
Parameters
callbackAction transferred into the existing managed binding.
originRegistration call site.
Returns
Checked Button registration result; use a pipe stage for registration before preparation.

◆ operator Ref< T >()

template<class T>
requires std::derived_from<T, Widget>
portals::ui::DynamicRef::operator Ref< T > ( ) const
inline
Template Parameters
TPublic Widget subtype tested during deferred/immediate name resolution.
Returns
Typed weak slot; wrong type records INVALID_ARGUMENT before startup or in the live collector. Conversion construction may allocate. A successful slot never retargets on later ID reuse.

◆ text()

TextProperty portals::ui::DynamicRef::text ( TextResolver resolver = {},
std::source_location origin = std::source_location::current() ) const
inline
Parameters
resolverOptional owning synchronous localization adapter.
originProperty acquisition call site retained for short mutations.
Returns
Existing checked text proxy; non-text widgets return INVALID_ARGUMENT.

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