I'm using the latest wxglade (cdc33fbee011).
I have a dialog that I want to save with no style(s) applied. Wxglade allows me to turn off all the styles for a dialog and then save it, but when I re-open the file, DEFAULT_DIALOG_STYLE is set again.
To recreate --
1) Create a new wxglade project
2) Add a dialog
3) On the dialog's properties pane, click the "Widget" tab. wxDEFAULT_DIALOG_STYLE is set by default.
4) Turn off wxDEFAULT_DIALOG_STYLE.
5) Save the project
6) Re-open it. wxDEFAULT_DIALOG_STYLE is on again.
There's probably several ways to fix this problem. I hacked a fix (patch attached) but it causes other problems so maybe it's not such a great fix. My fix was in two places --
1) In widget_properties.py, modified CheckListProperty.write() to write the property even if it is blank. With this change, wxglade will write <style></style> to the XML file if the style is blank.
2) In xml_parse.py, modified XmlWidgetBuilder.endElement() so that even if 'data' is blank, it calls the handler anyway.
The reason that I say my patch causes problem is because the second change causes a lot of these when I re-open my .wxg file:
Warning: property 'flag' not supported by this object ('<xml_parse.Sizeritem instance="" at="" 0x10d6d238="">')
My patch does, however, fix the problem with not being able to save & re-open a dialog with no styles set.
Log in to post a comment.