Repository navigation
Conversation
Add a disabled field and param to Dropdown, Switch, Radio, Slider, TextBox, Picture and Menu/MenuItem, and guard every input handler so disabled widgets cannot be clicked, focused, dragged or typed into. Dim their drawing with a shared dim_color helper. CheckBox.disabled was declared but never read; it now blocks both mouse and keyboard toggling. ListBox disabled items are no longer selectable via single-select clicks or arrow keys, draggable, or hover-highlighted. Focus navigation now skips disabled widgets via Focusable.is_disabled(), and set_focus/force_focus no longer steal focus for them. Document the new params in docs.md.
This was referenced Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
disabledwas only partially implemented. An audit of every interactive widget found:CheckBox.disabledwas declared, set in the constructor and documented indocs.md("Disable interaction"), but never read — a disabled checkbox still toggled by mouse and by Enter/Space.ListBoxdisabled items could still be selected by single-select mouse clicks and Up/Down keys, dragged, and hover-highlighted;is_item_selecteddisagreed between multi- and single-select mode.Focusable.has_focusable,set_focus,force_focus) never checkeddisabled, so disabled widgets were Tab-reachable and could steal focus.disabledstate at all.Button(see Add disabled check to btn_key_down() in button.v #629) is the only widget whose disabled state was already usable.Changes
disabledfield +disabledparam + dimmed drawing to Dropdown, Switch, Radio, Slider, TextBox, Picture, Menu and MenuItem.change_valueis guarded centrally as well.CheckBox.disabledactually block mouse and keyboard toggling.on_change), dragging and hover highlighting ignore them, andis_item_selected*is consistent.Focusable.is_disabled(); focus navigation,set_focus()andforce_focus()now skip disabled widgets instead of focusing them.dim_color()helper and document all new params indocs.md.Scope and verification notes
disabled/hiddenon any platform, andnative_button_set_enabled/ Win32EnableWindow/ShowWindoware declared but never called. That needs a separate cross-platform change.button.v.v fmt. A full type-check build is blocked by pre-existingmastererrors under V 0.5.2 (dropdown.v:103 immutable parent,layout_canvas.vshadowing/immutability, deprecatedusize/isize, and aC.DestroyWindowsignature conflict). The same errors occur on unmodifiedmaster; a patched baseline build showed no new errors from this change. CI onmasteris already red forlint/fmtand setup.