Disconnecting signals and connection control



Hello,

I have been experimenting with Spinbuttons and ProgressBars and thought to
combine them. The program I came up with was one that would allow to control
the speed of pulse (of ProgressBar) through a Spinbutton.
I have done these:

Define a new class Spin, which inherites from Window class,
add an Gtk::Adjustment, Gtk::SpibButton, Gtk::Alignment, Gtk::ProgressBar
etc

Spin::Spin()
: ...
{...
//this one is for connecting signal timeout with function on_timeout (m_Spin
is a SpinButton)
Glib::signal_timeout().connect(sigc::mem_fun(*this, &Spin::on_timeout),
m_Spin.get_value_as_int());
//(m_Adjust is an Adjustment) this one for connecting signal_value_change
with //on_spinbutton_digits_changed
m_Adjust.signal_value_changed().connect(sigc::mem_fun(*this,
&Spin::on_spinbutton_digits_changed));
..}

bool Spin::on_timeout()
{    m_Progress.pulse();
    return true;}

void Spin::on_spinbutton_digits_changed()
{    Glib::signal_timeout().connect(sigc::mem_fun(*this, &Spin::on_timeout),
m_Spin.get_value_as_int()); }

Anyway it works up to a point. The problem is that instead of getting the
value of SpinButton as an argument for signal_timeout connection it just
increases the speed. This makes me think that maybe I install new connection
with each SpinButton button press so they all work simultaneously and there
explained the speed increase?

So if this is the catch how do I disconnect signal_timeout?
-- 
View this message in context: http://old.nabble.com/Disconnecting-signals-and-connection-control-tp32668178p32668178.html
Sent from the Gtkmm mailing list archive at Nabble.com.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]