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

Question:

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.

Asked By: Adam

||

Answers:

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

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.

Answered By: QuentinC