Use of gtk spin buttons [WAS Re: Margins Plugin Bug]
jasper at moongroup.com
Sun Mar 30 17:02:56 CEST 2003
He-he, that's what you get for being arrogant ;-) I was so sure ...
Anyway, I gladly stand corrected and will now humbly get to work to fix
all my spinbuttons ;-)
On 30 Mar 2003 16:37:33 +0200
Olivier Fourdan <fourdan at xfce.org> wrote:
> On Wed, 2003-03-26 at 09:43, Jasper Huijsmans wrote:
> > Yeah, this is a gtk bug. Spinbuttons don't update their value
> > properly when using the keyboard. Nothing we can do about it, I'm
> > afraid. I didn't check if the gtk people know about it, though
> > (yeah, I'm lazy).
> No it's not. It's a bug in your code :P
> The correct way to get value changes is to connect a "value_changed"
> event to the spin adjustment, something like :
> TON(spin))), "value_changed", G_CALLBACK(a_callback), a_pointer);
> This, obviously , changes the callback function since the widget is
> now a GtkAdjustment (and not a GtkSpin anymore).
> The (int) value can then be retrieved with :
> val = gtk_adjustment_get_value(GTK_ADJUSTMENT(widget));
> if (val - floor (val) < ceil (val) - val)
> n = floor (val);
> n = ceil (val);
> Humm, and yes, that probably needs to be fixed elsewhere (in
> xfce4-panel, maybe :). I just fixed the margin plug-in for now.
> Olivier Fourdan <fourdan at xfce.org>
> Xfce4-dev mailing list
> Xfce4-dev at xfce.org
More information about the Xfce4-dev