Re: GTK signals question.



On Wed, 2014-03-05 at 02:20 -0500, Chris Moller wrote:
On 03/05/14 02:01, Chris Angelico wrote:
On Wed, Mar 5, 2014 at 5:43 PM, Chris Moller <moller mollerware com> wrote:
I'm writing an app, that among a lot of other stuff, has three mutually
interacting spinbuttuns, i.e., if I increment spinbutton A, its callback
then updates values in B and C.  B and then would try to update A, and C,
etc., resulting in a bottomless recursion.  So, what I need to do is, while
I'm in A's callback, block the B and C callbacks; while in in B, block A and
C and so on.
Are you simply setting the three to the same value? If so, just check
first to see if it's already that value, and if it is, don't set it.
That's a technique that's worked for me since my earliest GUI
programming days on VX-REXX... great system, that, pity it's bound to
the obscure and forgotten platform of OS/2! :)

No, they're not the same value.  They're all for setting an angle, in 
radians, pi-radians, and degrees, and I want the user to be able to set 
the angle in any unit and have the equivalent angle in the other units 
show up in the other spinbuttons.

Interesting, if I were you I would try to share the same adjustment
between all of your views.

I.e. I would keep the adjustment in the finest grained unit of each
unit you want to display, and have your spin buttons format the value
differently depending on what they are used for (or perhaps use GtkScale
if that makes sense in your UI).

The idea of multiple GtkAdjustments holding separate values when you
really only want a single value that is displayed differently by
different widgets - is a bit maddening.

Note that this might prove challenging with the way GtkAdjustment is
designed, I was just speculating that this approach of multiple
adjustments is not ideal... ideally these views should share the
same value.

Cheers,
    -Tristan




ChrisA
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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