Re: Event to get Gtk::SpinButton value on key press / release
- From: Lyle Underwood <lyleunderwood gmail com>
- To: gtkmm-list gnome org
- Subject: Re: Event to get Gtk::SpinButton value on key press / release
- Date: Sat, 12 Dec 2009 00:27:05 -0800
So as it turns out, my real problem was that
Gtk::SpinButton::get_value() does not match that of
Gtk::Entry::get_text(). For some reason get_value is not updated with
the SpinButton content on key press, but it is once tab is pressed to
lose focus. Gtk::Entry::get_text always seems to resolve immediately
however.
So now I'm using an on_change handler and in it I'm doing a string to
int conversion like:
int delayTime;
std::stringstream converter;
converter << delay->get_text();
if(!(converter >> delayTime).fail())
{}
This is not so much a crazy hack as it is an ugly work-around. It will
suffice for now. But shouldn't get_value be updated at the same time as
get_text? What's up with that?
Thanks,
Lyle
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]