You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, sorry to bother it's me again. I have another question popping up in the property_modification.py example. Namely, in callback you mention that settings are passed implicitly, however, how do you access them within the callback? I've tried a for key, val in kwargs.items(): print(key, val), but it does not produce anything. Thank you!
As an update, I can see that args[0] holds an obs_data_t object initially (assuming it's settings), but after pushing the button, it's emptied (as well as kwargs).
What are you trying to do? Have you found a post from @bfxdev about properties ? Maybe this is what are you looking for.
Also a page on the wiki
The property_modification.py example snippet was written in June 2020, and there was no intention to access settings in callback. They are passed implicitly using star arguments because later you cannot access it ( as you confirmed it ). **kwargs were passed just to make sure nothing breaks.
Take a look to a new example:
Thank you! On button press, I'm looking to auto-iterate integer counter widgets. Been using the global solution, but seems in script_update I may have been assigning in the wrong direction (settings = G.settings). I'll play some more with it, and if I get it working I'll post my solution...
Activity
jdbodyfelt commentedon Feb 9, 2021
As an update, I can see that
args[0]holds anobs_data_tobject initially (assuming it'ssettings), but after pushing the button, it's emptied (as well askwargs).upgradeQ commentedon Feb 10, 2021
What are you trying to do? Have you found a post from @bfxdev about properties ? Maybe this is what are you looking for.

Also a page on the wiki
The
property_modification.pyexample snippet was written in June 2020, and there was no intention to access settings in callback. They are passed implicitly using star arguments because later you cannot access it ( as you confirmed it ).**kwargswere passed just to make sure nothing breaks.Take a look to a new example:
In order to access settings in callback they must be global.
jdbodyfelt commentedon Feb 10, 2021
Thank you! On button press, I'm looking to auto-iterate integer counter widgets. Been using the global solution, but seems in
script_updateI may have been assigning in the wrong direction (settings = G.settings). I'll play some more with it, and if I get it working I'll post my solution...MarioMey commentedon Feb 10, 2021
@jdbodyfelt if you have more questions, ask them in Discussion section. There is where I ask my doubts 😉.