Hello Jean-Michel,

Because a signal can have many listeners, which is often useful.

In order to disconnect a signal, keep the boost::signals::connection
object that the call to connect() returns, and use that to disconnect
the signal later:

boost::signals::connection c = button_->clicked().connect(this, &MyApp::foo1);

// and later:
c.disconnect();

BR,
Wim.

2010/11/12 Jean-Michel Caricand <[email protected]>:
> Hello,
>
> I have a WPushButton member. I want to connect a event :
>
> button_->clicked().connect(this, &MyApp::foo1);
>
> That works fine. Now, I want to connect another event :
>
> button_->clicked().connect(this, &MyApp::foo2);
>
> My problem : when I click button_, foo1() and foo2() are called. Why
> foo1() is not disconnected ?
>
> Thanks
>
>
> ------------------------------------------------------------------------------
> Centralized Desktop Delivery: Dell and VMware Reference Architecture
> Simplifying enterprise desktop deployment and management using
> Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
> client virtualization framework. Read more!
> http://p.sf.net/sfu/dell-eql-dev2dev
> _______________________________________________
> witty-interest mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture
Simplifying enterprise desktop deployment and management using
Dell EqualLogic storage and VMware View: A highly scalable, end-to-end
client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to