48#ifndef STAGE_MODEL_W_LINK_H
49#define STAGE_MODEL_W_LINK_H
56#include <sigc++/trackable.h>
63 using error::LUMIERA_ERROR_BOTTOM_VALUE;
132 if (tl == tr)
return;
141 operator bool()
const
186 if (
widget_ == &otherTarget)
return;
197 ,
LERR_(BOTTOM_VALUE));
207 static_assert (std::is_base_of<sigc::trackable, TAR>()
208 ,
"target type required to be sigc::trackable");
211 target.add_destroy_notify_callback (&
widget_
214 TAR* & widgetPtr = *
static_cast<TAR**
>(p);
221 catch (std::exception& problem)
223 throw error::External (problem,
_Fmt{
"WLink could not attach to %s. Problem is %s"} % target % problem);
227 ERROR (
stage,
"Unknown exception while attaching WLink");
228 throw error::External (
_Fmt{
"WLink could not attach to %s due to unidentified Problems"} % target);
Managed link to a sigc::trackable UI widget, without taking ownership.
TAR * attachTo(TAR &target)
void connect(TAR &otherTarget)
(re)connect this smart link to the given target.
void __ensureAlive() const
WLink & operator=(WLink other)
void clear()
detach and deactivate this link
friend void swap(WLink &l, WLink &r)
swap the pointees, including callback registration.
A front-end for using printf-style formatting.
Lumiera error handling (C++ interface).
#define ERROR_LOG_AND_IGNORE(_FLAG_, _OP_DESCR_)
convenience shortcut for a sequence of catch blocks just logging and consuming an error.
LumieraError< LERR_(STATE)> State
LumieraError< LERR_(EXTERNAL)> External
Lumiera GTK UI implementation root.