简体   繁体   中英

Python on Windows: How to enclose widgets in wxPython to labelled group, similarly to <fieldset> in HTML?

In Python on Windows, using the wxPython library, is there a way how to group wx widgets into a wrapper that can be given an accessible label? I am looking for something like <fieldset> element in HTML which can be named using the <legend> element.

The reason I need this is because I want to group several wx.CheckBox widgets into such named group, so that when screen reader user enters this group by moving focus to one of its checkboxes, the accessible label is read.

The thing that looks the most like what you want is probably wxStaticBox , easier to use viawxStaticBoxSizer .

If you are using the sizer, you can use it just like other sizers, which is very convenient. Otherwise you can create the wxStaticBox manually.

This is the method of choice to group related radio buttons or checkboxes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM