synchronize widgets without redundant signals

I am working on an application that will have multiple widgets that
display the same value in different ways. For example I could have a
scroll bar that represents a numeric value, and an entry that also
represents the same value. That way the user can either slide the scroll
bar or enter a value into the entry.

What I am trying to avoid is having one value update cause multiple
signals to be emitted. The concern is that this could lead to an
infinite loop, particularly if the datatypes aren't exact with each
other, and one widget update rounds one way and another rounds another
for example.

I'm looking for a way to call a widget's set_value() without having the
on_value_changed() called, or the signal_value_changed() emitted. That
way I can update a widget to reflect the current value (say from another
widget's change by the user) without it then trying to signal back to
other widgets to update. I need a way to know when a widget is being
updated by the user acting on the widget versus my own use of
set_value() within the program.

Unless of course there is a better way altogether.


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