Closed grzesl closed 12 months ago
Thanks! yes, callbacks were really hard to implement, so I had this problem of multiplexing different callbacks, usually it passes some reference with it.. all my uses cases were using global callbacks, so generating just one was fine.
But trick is that you can copy generated code into separate human-made file and name those callbacks as you want. Yes, it will have some generated ugliness within, but you can give them nice public names and actually use multiple.
Thanks for your advice. I will try to implement the custom managment.
Hello, First of all - thank You for developing the c-for-go.
I develop little library in GO using Your generator. I Figured out that there is a issue with callbacks. For example i have using one function to manage two callbacks:
1) ug.UG_WindowCreate(&window1, obj, MAX_OBJECTS, window_1_callback) 2) ug.UG_WindowCreate(&window2, obj, MAX_OBJECTS, window_2_callback)
The result is that all events are received by window_1_callback . I have keep digging and found that in generated code is something like that:
and where the callback i called:
So, there is only one callback managed by c-for-go (the first one defined)?
I thing in code i have mentioned should be a slice of callbacks functions proxy or map:
and call:
Thank You grzesl