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

[LVGL] Add user_data to event callbacks #457

Closed
itarozzi opened this issue Jul 26, 2024 · 1 comment
Closed

[LVGL] Add user_data to event callbacks #457

itarozzi opened this issue Jul 26, 2024 · 1 comment
Assignees
Milestone

Comments

@itarozzi
Copy link

Is your feature request related to a problem? Please describe.

At the moment does not exists a way to add user_data to a callback button. I see I can link a button event to an UserAction, but no way to pass user_data to them.

I would like to use same callback for several widgets, but I need to get caller ID or caller data (without using global variables)

Describe the solution you'd like

I would like an edit box in the event panel to assign number or variable name or obj reference. This parameter will be passed to lv_obj_add_event_cb() generated by eez-studio.

Describe alternatives you've considered

I'll try to use variables with Flow assignement, but I don't know if the flow is executed before the event call, so I can check the variable value inside the User Action implementation in my C code

@mvladic mvladic added this to the M22 milestone Aug 28, 2024
mvladic added a commit that referenced this issue Aug 30, 2024
@mvladic
Copy link
Contributor

mvladic commented Aug 30, 2024

Implemented.

It is now possible to specify integer user data:

image

@mvladic mvladic changed the title LVGL: add user_data to event callbacks [LVGL] Add user_data to event callbacks Aug 31, 2024
@prasimix prasimix closed this as completed Sep 3, 2024
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

3 participants