
It took me way too long, but now I know how to handle the value-changed event of GtkScale.
In Glade:
Create a GtkScale widget. We will ID it foo_scale.
In the Signals -> GtkRange -> value-changed line change the Handler
field to something sensible like on_foo_scale_value_changed. That will
be the name of the handler.
Make a new Adjustment in:
General ->
Adjustment ->
(little pen button in the field) ->
Choose a [sic] Adjustment in this project ->
NewRename the adjustment to something sensible like foo_adjustment and set
the Value, Minimum Value, Maximum Value, etc. Those are kind of self
explanatory…
In Python, your handler will be called with a single argument - the signal
emitting object, which is the GtkScale object itself. It has a method,
get_value(), used to get its current value:
def on_foo_scale_value_changed(emitter):
scale_value = emitter.get_value()
do_stuff_with_scale_value(scale_value)Fin.
Tag feeds:Kaka Farm by Yuval Langer is licensed under Attribution-ShareAlike 4.0 International