I have a small application used for creating/editing entries in a small database.
I use a wx.Dialog derived class to create or edit items.
Each items can be of 2 types so I use a boolean for this entry field.
The dialog have a first line with 2 wx.RadioButtons for this type, others controls(text, combobox) and a ‘OK/Cancel’ separated button sizer.
The Ok button is automatically enabled/disabled using an Update_UI event, depending on the content of the controls.
But the problem is that the status of the radiobuttons is inverted when the update_ui event disables the ok button (for example, when I whant to create a new entry, showing the dialog with empty controls).
If the Ok button stays enabled at creation time, all is Ok.
I have created a small simplified project to show the problem.
I consists oof a frame with 3 buttons:
- the fist one should show the dialog with empty controls (creating a new item) and with the 'Mode 1" radio button selected, but it is shown with the “Mode 2” one selected
- the second one does the same thing, but with the “Mode 1” radio button selected instead of the “Mode 2” one
- the third button show the dialog with filled controls(editing an item). Values of the radiobuttons are not inverted in this case as the Ok button is enabled.
If I disable the “Update_UI” event (commenting line 62 of DlgAddEditItem.py), all works fine.
Is this a bug or a ‘normal thing’ ?
DialogTest.zip (4.1 KB)