Re: Control user change of SpinButton value



This may be a bit clunky, but you could put a pthread_mutex in your class and then insert a pthread_mutex_trylock call in the callback slot to the spin button which would just return if unable to get the lock on the mutex. Then, when you are going to make a change to the spin button from code, just lock the mutex first; ergo, the callback only does its work when the user accesses alters the control.

Bob Caryl

Josepo Urrutia wrote:
I've some Gtk::SpinButton in my application and I need to control when the user change the values of those spinbuttons.

If I use the Gtk::SpinButton::signal_value_changed I can do a callback whenever the value of a spinbutton is changed, the problem is that this callback is also fired if the value is changed by the code not only by the user.

Using the Gtk::Entry::signal_activate makes me able to know when the user has enter a value hitting the return key but not by using the mouse over the "up/down" buttons.

I've tried with some more signal has Gtk::Widget::signal_button_release but no luck.

Is there a simple way to know when the user has change a value of a spinbutton?, or to be more expecific when the "up/down" buttons had been pressed?


_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list




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