Replies: 2 comments 2 replies
-
Yes, this is very useful, you can create a PR 👍 Call point: Line 4198 in ead9970 |
Beta Was this translation helpful? Give feedback.
2 replies
-
Here's a proposed implementation: #488 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When you're programming in C (or Rust, etc.) it's easy to create a C function with the following signature...
... and set it as the file handler of a given window with
webui_set_file_handler(window, handler)
. In C it's easy to create different functions for different windows.But when you use another (dynamic) language and you use a compiled version of webui then it may be difficult to create a new C function for each window. In these programming languages you probably want to create a single file handler and compile it as a library, and then let the file handler act differently depending on which window it's handling. Sadly the file-handlers have no idea which window they're serving.
An enhancement could be to modify the file handler signature to:
this is, send the window
num
to the file handler as a first argument.The change will require modifying the API (or augmenting it with a different file handler function, say
webui_set_file_handler_window
), but should be easy to implement otherwise.I can submit a PR if this you consider this useful.
Beta Was this translation helpful? Give feedback.
All reactions