Re: Event to get Gtk::SpinButton value on key press / release



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]