Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add checkbox/radio toggle callback #74

Closed
ImpulseAdventure opened this issue Nov 1, 2018 · 1 comment
Closed

Add checkbox/radio toggle callback #74

ImpulseAdventure opened this issue Nov 1, 2018 · 1 comment
Milestone

Comments

@ImpulseAdventure
Copy link
Owner

The current checkbox / radio button implementation registers a default touch callback function (gslc_ElemXCheckboxTouch()) that handles basic checkbox / radio button operations. There is also a function gslc_ElemXCheckboxGetState() that can be used to fetch the current state of the checkbox.

However, it would be very useful to add a user-defined callback function that is invoked whenever a checkbox / radio button is toggled. This way the user code can take action upon a change in state, rather than polling for changes.

One implementation of this may be to add a callback function pointer member pfuncXToggle to the XCheckbox pXData structure. A new call ElemXCheckboxSetToggleFunc() would assign this callback (like in ElemXSliderSetPosFunc()) and then the callback would be invoked whenever ElemXCheckboxSetState() is called.

ImpulseAdventure added a commit that referenced this issue Jan 15, 2019
- Assign callback with ElemXCheckboxSetStateFunc()
@ImpulseAdventure
Copy link
Owner Author

Feature implemented and example ex04_ard_ctrls has been enhanced to demonstrate the usage.

This was referenced Jan 15, 2019
@ImpulseAdventure ImpulseAdventure added this to the 0.11.0 milestone Feb 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant