Re: [patch] gtk_spin_buttons



On Tue, Jan 05, 1999 at 12:09:46AM +0200, Osku Salerma wrote:
> I brought up the subject couple of days ago on gtk-list about how the
> gtk_spin_button_get_value* functions return incorrect values if
> they're called from a callback function that's attached to a button
> that has had the GTK_CAN_FOCUS flag unset, since the spin button
> widget only updates its internal value when it gets a focus_out event.
> 
> No gtk maintainers replied but one person did, mentioning that he'd
> brought up the same subject a long time ago and never did get a
> response. So I figured I'd hack together a patch to fix it and see if
> that'd trigger a response. The patch adds code to keep a flag,
> text_changed, that indicates whether the value should be updated. It
> works for me with gtk 1.1.11 and should patch cleanly against 1.1.12
> too.

[...]

With that patch the "text_changed" flag is a bit useless, because it will
be TRUE most of the time. As soon as you press an up/down button
gtk_spin_button_value_changed calls gtk_entry_set_text which will
emit an editable::changed signal... So it would be easier to call
gtk_spin_button_update within gtk_spin_button_get_value_as_float/int.
Maybe it would be even better to make gtk_spin_button_update public.
Unfortunately there is a feature freeze so for now one have to call
gtk_signal_emit_by_name (sb, "activate") to easily force an update.

bye,
  Lars



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