Hello, I have been looking around and have found nothing but is there a way to enable a checkbox by default? meaning when I start the imgui the box will be checked as well with the function. C++
ty
static bool checked = true;
Checkbox("checkbox", &checked);
Set the boolean to true before the first time calling Checkbox.
ty
but how do you set the checkbox already checked?
ImGui::Checkbox( charenc( "Watermark" ), &Vars.Misc.Watermark );
I tried
ImGui::Checkbox( charenc( "Watermark" ), &Vars.Misc.Watermark, &checked );
but too many arguments.
but how do you set the checkbox already checked?
Vars.Misc.Watermark = true;
Alright it worked... lol but now I cant uncheck it..
Are you sure you're not resetting it every time before calling ImGui::CheckBox again? This is usually the case the the most of us aren't used to "immediate mode gui" style of handling variable changes and updates.
The bool value is yours.
Checkbox() just toggles it when you click.
Most helpful comment
Are you sure you're not resetting it every time before calling ImGui::CheckBox again? This is usually the case the the most of us aren't used to "immediate mode gui" style of handling variable changes and updates.