Mr Flibble
unread,Aug 13, 2016, 3:59:48 PM8/13/16You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi!
My new GUI library "neoGFX" doesn't use signals and slots as signals and
slots are an old solution to an old problem. Instead all we need to do is:
button1.clicked([](){...});
If you need to unsubscribe from the event (which you should do if any
objects associated with your event handler will be destroyed before the
event source is destroyed) then simply use a "sink" object:
sink s;
s += button1.clicked([](){...});
Here when 's' is destroyed any associated event subscriptions will be
unregistered automatically. A sink can be an object on the stack, a
member variable or a base class.
/Flibble