GithubHelp home page GithubHelp logo

Comments (5)

pthom avatar pthom commented on June 15, 2024 1

Thanks for the proposition. I'm always happy to accept qualitative PRs :-)

In this case I had already started working on it, so I finished it.

Here is some more information if you want to contribute in a later: This kind of work requires to run the generator. There is some doc about it here: https://pthom.github.io/imgui_bundle/devel_docs/bindings.html, and here: https://pthom.github.io/litgen/litgen_book/00_00_intro.html

  1. First I had to add some manual new methods in the node editor fork: pthom/imgui-node-editor@daccee1...cefbd3e#diff-805621e5151ef6f5b47901439963a38fa5a9f2bfb7dee7cb6a9f18116bb2fc9f (They are protected by this specific define: IMGUI_BUNDLE_PYTHON_API)

  2. Then I had to add this specific define in the generator options, then rerun the generator: 7b61b6c

from imgui_bundle.

pthom avatar pthom commented on June 15, 2024

There is no way to access them as an array, but there is a way to set them:

    ed.push_style_color(ed.StyleColor.node_bg, ImVec4(0.2, 0.2, 0.2, 1.0))

from imgui_bundle.

hugle avatar hugle commented on June 15, 2024

But I see imgui style color is done correctly at:

# python adapter for ImGuiStyle::Colors[ImGuiCol_COUNT]
# You can query and modify those values (0 <= idxColor < Col_.count)
# inline IMGUI_API ImVec4& Color_(size_t idxColor) { IM_ASSERT( (idxColor >=0) && (idxColor < ImGuiCol_COUNT)); return Colors[idxColor]; } /* original C++ signature */
def color_(self, idx_color: int) -> ImVec4:
pass
# inline IMGUI_API void SetColor_(size_t idxColor, ImVec4 color) { IM_ASSERT( (idxColor >=0) && (idxColor < ImGuiCol_COUNT)); Colors[idxColor] = color; } /* original C++ signature */
def set_color_(self, idx_color: int, color: ImVec4) -> None:
pass

Why not apply the same wrapper?

from imgui_bundle.

hugle avatar hugle commented on June 15, 2024

Or maybe, is the same way imgui does also applies to imgui_node_editor? If so, I could create a PR if you don't have capacity for this.

from imgui_bundle.

hugle avatar hugle commented on June 15, 2024

Cool, @pthom , thanks very much for the fast patch.

from imgui_bundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.