Re: SpinButton: how to avoid calling signal handler when set_value()



Op 11/03/2016 om 10:47 AM schreef pozzugno:
Another situation, similar to mine. You have a dialog window with a
SpinButton showing the volume speaker. When the dialog is shown, the
SpinButton value should be the current volume level. The user could
change the volume speaker by changing the value of the SpinButton, so
a callback for the "value-changed" signal is connected. The callback
calls the OS API to change the volume speaker.
In this scenario (I think it's very common in GUI applications), the
value of the SpinButton can be changed by code (when the dialog is
shown) and by the user (when he wants to change the volume speaker).


So you need to keep properties in sync with each other, right? Binding
widgets properties is possible even with some conversion, see [1].


As you refuse to give proper example code I'll leave it at this, good luck.


~infirit

[1]
https://lazka.github.io/pgi-docs/#GObject-2.0/classes/Object.html#GObject.Object.bind_property





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