Re: [gtkmm] Signal disconnect
- From: Matthew Walton <matthew alledora co uk>
- To: bryan reigndropsfall net
- Cc: gtkmm-list gnome org
- Subject: Re: [gtkmm] Signal disconnect
- Date: Tue, 06 Apr 2004 16:47:29 +0100
bryan reigndropsfall net wrote:
I'm sure this has been asked a million times on this list, but since the
search feature of mailman (the archive system for gnome mail) sucks, I'm
going to ask again. How do I disconnect a signal handler from a signal?
I've got a handler connected to the row_changed signal of my TreeView, but
I want to run an iterator to update the contents of each row, but I don't
want the signal handler to pick that up. I know I could set up a check
for a boolean inside the handler and when I run my iterator on the
TreeView's rows I could just check if the boolean is set or not, but I
figured there had to be a better way to do this. Thanks in advance!
Easy enough:
sigc::connection c =
widget.signal_whatever().connect(sigc::mem_fun(whatever, whatever));
Then keep hold of c until you want to disconnect, and when you do, call
c.disconnect().
Works in libsigc++ 1.2 as well, with the appropriate changes:
SigC::Connection c =
widget.signal_whatever().connect(SigC::slot(whatever, whatever));
c.disconnect();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]