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

Question: Adding DearPyGui to existing imgui C++ application with an embedded Python interpreter #2322

Open
sebasth opened this issue Apr 19, 2024 · 0 comments
Labels
state: pending not addressed yet

Comments

@sebasth
Copy link

sebasth commented Apr 19, 2024

Is there a way to use this library in existing C++ imgui project. I have an embedded Python interpreter in my program and would like to call python code from C++ to draw additional gui widgets, something like:

my_python_gui.py

def my_py_gui():
    with dpg.window(label="Example Window"):
            dpg.add_text("Hello world")
            dpg.add_button(label="Save", callback=save_callback)
            dpg.add_input_text(label="string")
            dpg.add_slider_float(label="float")

and rendering loop in C++ (with pybind11):

...

ImGui_ImplGlfw_NewFrame();
ImGui::NewFrame();
...
// C++ imgui
...
// Python imgui (assuming the above python script previously loaded)
py::exec("my_py_gui()");
...
ImGui::Render();

@sebasth sebasth added the state: pending not addressed yet label Apr 19, 2024
@sebasth sebasth changed the title Adding DearPyGui to existing imgui C++ application with an embedded Python interpreter Question: Adding DearPyGui to existing imgui C++ application with an embedded Python interpreter Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: pending not addressed yet
Projects
None yet
Development

No branches or pull requests

1 participant