Repository navigation
Hide and show a field's label with the field - #16
Merged
Merged
Conversation
WXWidget.hide()/show() acted only on the control, so a field declared hidden=True (or hidden later) left its label visible and announced by screen readers. Also hide/show label_control, and lay out the parent so the remaining controls reposition. Fixes #13
Laying out only the parent left a nested panel at its old size, so showing a field in it clipped the controls below. Laying out only the top-level window misses the flat case: a plain wx.Frame just resizes its sole child to the same size, which does not re-lay out the panel. Walk up instead. Refs #13 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SeWnvmhxfidv6uFB5MxaYG
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.
Fixes #13.
WXWidget.hide()andshow()now hide and showlabel_controlwith the control, then callLayout()on every ancestor up to the top-level window. Rendering withhidden=Truegoes throughhide(), so it's covered.Why every ancestor: when only the parent was laid out, a nested panel stayed at its old height and clipped the next field. Laying out only the top-level window broke the flat case: a plain
wx.Framehas no sizer, so the panel never re-laid out.Verified on Windows (wx 4.3.2 msw, private desktop, UIA via pywinauto):
SizedPanelwithfields.Text(label="Notes", multiline=True, hidden=True)reads Edit "Email address" → Text "Kind", with no stray Text "Notes", in both theformandverticallayouts.show(), the label is at (3, 3), the control at (3, 25), and the next label moves to (3, 69). Afterhide(), the next label returns to (3, 3).The nested case was checked on Linux (wx 4.2.1 gtk3, Xvfb) only.