Giter Club home page Giter Club logo

Comments (3)

Gnimuc avatar Gnimuc commented on July 4, 2024

I was wondering whether that functionality is somehow added/addable through CImGui.jl?

It looks like this feature is already in ocornut's TODO list, it would be great if it could come into 1.70. Since CImGui.jl is just a wrapper and not able to provide additional internal features like this one, the only feasible way is to manually patch imgui and expose that API like what CImGuiBuilder did here.

from cimgui.jl.

Gnimuc avatar Gnimuc commented on July 4, 2024

Now those internal APIs are supported in CImGui.LibCImGui, so we can implement this on the Julia side:

julia> using CImGui, CImGui.LibCImGui

julia> include(joinpath(pathof(CImGui), "..", "..", "examples", "Renderer.jl"))
Main.Renderer

julia> using .Renderer

julia> Renderer.render(width = 360, height = 480, title = "IMGUI Window") do
           CImGui.CSyntax.@cstatic disabled=false begin
               CImGui.Begin("Hello ImGui")
               CImGui.CSyntax.@c CImGui.Checkbox("Disable", &disabled)
               if disabled
                   igPushItemFlag(ImGuiItemFlags_Disabled, true)
                   CImGui.PushStyleVar(ImGuiStyleVar_Alpha, 0.5)
               end
               CImGui.Button("My Button") && @show "trigger"
               if disabled
                   igPopItemFlag()
                   CImGui.PopStyleVar()
               end
               CImGui.End()
           end
       end

from cimgui.jl.

IanButterworth avatar IanButterworth commented on July 4, 2024

Great! Thanks for the example

I'll close this but if I come across any issues will reopen

from cimgui.jl.

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.