Calling setters should trigger any associated event #85

Closed
jarvisteach opened this Issue Jan 17, 2017 · 4 comments

Comments

Projects
None yet
1 participant
@jarvisteach
Owner

jarvisteach commented Jan 17, 2017

If setters are called programatically, then any associated functions should be triggered.

eg. if there is a scale with an associated function:

app.addScaleRange("col", 0, 255)
app.setScaleFunction("col", changeColour)

Then, calling app.setScale("col", 50)
Should trigger the function: changeColour

Maybe have a boolean flag in appJar, to disable this feature if required, although should default to on: app.disableFunctionCallbacks()

@jarvisteach jarvisteach self-assigned this Jan 17, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jan 19, 2017

Owner

This feature should be present on:

  • RADIOBUTTON / CHECKBUTTON
  • OPTIONBOX / SPINBOX / LISTBOX
  • SCALE

Where to find events:

  • OPTIONBOX, the function is registered as a trace on the variable
  • LISTBOX, the function is bound the the <> event
  • remaining, function is stored as the command config attribute

Might be simpler to store the events as variables, rather than trying to dig them out, but could cause problems later...

Owner

jarvisteach commented Jan 19, 2017

This feature should be present on:

  • RADIOBUTTON / CHECKBUTTON
  • OPTIONBOX / SPINBOX / LISTBOX
  • SCALE

Where to find events:

  • OPTIONBOX, the function is registered as a trace on the variable
  • LISTBOX, the function is bound the the <> event
  • remaining, function is stored as the command config attribute

Might be simpler to store the events as variables, rather than trying to dig them out, but could cause problems later...

jarvisteach added a commit that referenced this issue Jan 26, 2017

jarvisteach added a commit that referenced this issue Jan 27, 2017

jarvisteach added a commit that referenced this issue Jan 28, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jan 28, 2017

Owner

Code added to support function on scale, spin, list, cb, rb
Not needed on listbox, as function is called when variable changes...
New example added (setterExample.py), to test each one...

Owner

jarvisteach commented Jan 28, 2017

Code added to support function on scale, spin, list, cb, rb
Not needed on listbox, as function is called when variable changes...
New example added (setterExample.py), to test each one...

jarvisteach added a commit that referenced this issue Jan 28, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Jan 28, 2017

Owner

Issue with scale - the very first time it is set, it calls the function twice...

Owner

jarvisteach commented Jan 28, 2017

Issue with scale - the very first time it is set, it calls the function twice...

@jarvisteach jarvisteach modified the milestone: 0.05 Feb 25, 2017

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Mar 11, 2017

Owner

Issue with scales is slightly different - the function gets called the first time the window is drawn - after the eventLoop starts. This looks to be default action of the tkinter widget, so will be ignored.

Owner

jarvisteach commented Mar 11, 2017

Issue with scales is slightly different - the function gets called the first time the window is drawn - after the eventLoop starts. This looks to be default action of the tkinter widget, so will be ignored.

jarvisteach added a commit that referenced this issue Apr 14, 2017

Updates to Events (#103 & #114 & #85)
Lots of tweaks to how events are registered/called.
Updated documentation to reflect state of events.

Other miner documentation tweaks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment