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

V-WebUI | To-Do List #17

Closed
14 of 15 tasks
malisipi opened this issue May 6, 2023 · 8 comments
Closed
14 of 15 tasks

V-WebUI | To-Do List #17

malisipi opened this issue May 6, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@malisipi
Copy link
Contributor

malisipi commented May 6, 2023

@malisipi malisipi changed the title webui.is_shown function is missing Missing Features May 6, 2023
@hassandraga
Copy link
Member

There're no V way to get element id from event (Create <webui.Event>.element function)

Do you mean C.webui_event_t.element?

@malisipi
Copy link
Contributor Author

malisipi commented May 6, 2023

Do you mean C.webui_event_t.element?

Actually yes and no. C.webui_event_t.element is char and not native type. So the function will get the char, convert it to native string type and return it

@hassandraga
Copy link
Member

The V wrapper uses a direct call from C-WebUI to V callbacks. It works well, but I made another approach for the Python, Go and C++ wrappers. I created an event handler function that receives all events from the WebUI library first, then converts data to the native language format and calls the user callback.

[WebUI] -> [V Wrapper Events Handler] -> [End-user callback]
                 *
                 *
                 * * * Here, you can convert (C.webui_event_t) to (Native V Event struct of your choice)

Nothing forced me to use this approach in all three wrappers I made, but I did it anyway just for fun and to learn new things in other languages.

@malisipi
Copy link
Contributor Author

malisipi commented May 6, 2023

I like the approach. I will implement it as like that. Also it gives the native feeling to developers. While they can use the value directly, why do they need to use a extra function?

@malisipi
Copy link
Contributor Author

malisipi commented May 7, 2023

vwebui_event_handler will handle c-events with webui_bind. And vwebui_event_handler will trigger v-events. V-events will be registered with vwebui_bind. Also vwebui_bind will trigger webui_bind to register event.

@malisipi
Copy link
Contributor Author

malisipi commented May 7, 2023

It's nearly done with #18. However it's using global variables that not recommend. I will fix it and merge it

@malisipi
Copy link
Contributor Author

malisipi commented May 7, 2023

Actually it's still using global variables but [translated] flag (in module) is stopping the annoying error.

@malisipi malisipi changed the title Missing Features To-Do List May 7, 2023
@malisipi malisipi added the enhancement New feature or request label May 7, 2023
@malisipi malisipi pinned this issue May 7, 2023
@malisipi malisipi changed the title To-Do List V-WebUI | To-Do List May 12, 2023
@ttytm
Copy link
Member

ttytm commented Aug 23, 2023

The last open point might have been resolved with webui-dev/website#3

@ttytm ttytm unpinned this issue Sep 25, 2023
@ttytm ttytm closed this as completed Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants