-
Notifications
You must be signed in to change notification settings - Fork 25
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
Method to disable/grey-out widgets? #7
Comments
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. |
Now those internal APIs are supported in 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 |
Great! Thanks for the example I'll close this but if I come across any issues will reopen |
It seems that disabling/greying-out widgets to prevent user interaction in imgui itself isn't well implemented (see ocornut/imgui#211), but I was wondering whether that functionality is somehow added/addable through CImGui.jl?
Also, thanks for all the work on this package! It's been a delight to work with
The text was updated successfully, but these errors were encountered: