-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Extending ImGUI with custom widgets? #28
Comments
Hello, This is one area that I want to improve on and I expect many similar requests in the future (people around me who have been using the library asked for that as well). a/ b) I am interested in your feedback if you try that, and seeing how implementing new custom widgets goes for you. Any confusion you have is probably a hint toward something that can be improved. Then I can potentially make that change into core ImGui, make the #include optional via a #define in imconfig.h, etc. |
I added a #define IMGUI_INCLUDE_IMGUI_USER_CPP that implement the solution suggested in b) |
This is solved afaik with IMGUI_INCLUDE_IMGUI_USER_INL / IMGUI_INCLUDE_IMGUI_USER_H |
Great, thanks Omar! I meant to tell you that your solution sounded fine, and I ended up just including your cpp code directly into my own file where I added a few extra functions. I also came up with a nice oscilloscope plot, based mostly on your graph but with units and the y-limits labeled. I'm really appreciative that you took the time to share this. It's been super helpful in putting simple frontends on tools I build in lab. This one monitors a load cell coming in via a DAQ and sends it out via UDP. |
Hey Omar,
In using ImGUI for a project, I'd like to make a custom plot widget (e.g. multiple timeseries on the same axis). I'm wondering how I should go about implementing something like this. I can't just copy the code for ImGui::Plot outside of imgui.cpp, because some of the methods it calls are declared static. I could just add a new method to your ImGui namespace, but then I'm editing the imgui.cpp file directly, which means I'd have to merge in any updates that you push. Have you given any thought to how a developer could add their own widgets?
Obviously messing around with the low level ImGui code might break things if I don't implement it correctly, but this seems fine given the purpose.
The text was updated successfully, but these errors were encountered: