AllenDang / giu

Cross platform rapid GUI framework for golang based on Dear ImGui.
MIT License
2.16k stars 128 forks source link

How to disable widget #744

Closed mikigal closed 5 months ago

mikigal commented 6 months ago

Related problem

Hi, I want to disable some widgets (e. g. combo and checkbox) in the same way I as can do it with button

g.Button("Start").OnClick(handleButton).Size(360, 30).Disabled(true)

How can I achieve it?

Your request

Implement Disabled() function into other widgets same as for button

Alternative solution

No response

Additional context

No response

gucio321 commented 6 months ago

Check Push/PopDisabled

mikigal commented 6 months ago

Can you provide more details? I didn't find any method for disabling widgets, most are related to colors/fonts/styles

gucio321 commented 6 months ago

It's in cimgui (begindisabled), ill provide more details tomorrow

gucio321 commented 5 months ago

well, tommorow wasn't tomorrow, but: There is a function in cimgui-go: BeginDisabled and EndDisabled. Use them in giu.Custom call. YOu can also use giu.Style().SetDisabled(true).To(...)