wxGlade / wxGlade

wxGlade is a GUI builder written in Python for the GUI toolkit wxWidgets / wxPython. Documentation snapshot: http://wxglade.sourceforge.net/docs/index.html
http://wxglade.sourceforge.net/
MIT License
324 stars 52 forks source link

wxGlade crashes when changing a stockitem manually #383

Closed Slechtvalk closed 4 years ago

Slechtvalk commented 4 years ago

During addition of a wxButton , I manually changed the stock item ID to "DUPLICATE" to indicate that I wanted to issue the wxID_DUPLICATE ID to this button. wxGlade crashed, it appears because of this identifier. Also, it refused to start again. I had to remove the DUPLICATE name from the XML file in order to load the configuration again.

I guess it would be beneficial if you could add any stockitem that is not in the list, manually.

Exception type: <type ‘exceptions.KeyError’>

Best regards,

Ewout Boks

Exception details: u’DUPLICATE’

Application stack traceback: File “/Applications/wxGlade/wxGlade-0.9.4/tree.py”, line 843, in on_left_dclick self.show_toplevel(None, widget) File “/Applications/wxGlade/wxGlade-0.9.4/tree.py”, line 974, in show_toplevel self._show_widget_toplevel(node) File “/Applications/wxGlade/wxGlade-0.9.4/tree.py”, line 922, in _show_widget_toplevel self.create_widgets(c) File “/Applications/wxGlade/wxGlade-0.9.4/tree.py”, line 905, in create_widgets self.create_widgets(c) File “/Applications/wxGlade/wxGlade-0.9.4/tree.py”, line 905, in create_widgets self.create_widgets(c) File “/Applications/wxGlade/wxGlade-0.9.4/tree.py”, line 901, in create_widgets node.widget.create() File “/Applications/wxGlade/wxGlade-0.9.4/edit_sizers/edit_sizers.py”, line 784, in create self.create_widget() File “/Applications/wxGlade/wxGlade-0.9.4/edit_sizers/edit_sizers.py”, line 1461, in create_widget c.create() File “/Applications/wxGlade/wxGlade-0.9.4/edit_sizers/edit_sizers.py”, line 784, in create self.create_widget() File “/Applications/wxGlade/wxGlade-0.9.4/edit_sizers/edit_sizers.py”, line 1461, in create_widget c.create() File “/Applications/wxGlade/wxGlade-0.9.4/edit_sizers/edit_sizers.py”, line 784, in create self.create_widget() File “/Applications/wxGlade/wxGlade-0.9.4/edit_sizers/edit_sizers.py”, line 1461, in create_widget c.create() File “/Applications/wxGlade/wxGlade-0.9.4/edit_sizers/edit_sizers.py”, line 784, in create self.create_widget() File “/Applications/wxGlade/wxGlade-0.9.4/edit_sizers/edit_sizers.py”, line 1560, in create_widget c.create() File “/Applications/wxGlade/wxGlade-0.9.4/edit_sizers/edit_sizers.py”, line 784, in create self.create_widget() File “/Applications/wxGlade/wxGlade-0.9.4/edit_sizers/edit_sizers.py”, line 1461, in create_widget c.create() File “/Applications/wxGlade/wxGlade-0.9.4/edit_windows.py”, line 158, in create self.create_widget() File “/Applications/wxGlade/wxGlade-0.9.4/widgets/button/button.py”, line 51, in create_widget label = ButtonStockItems.stock_ids[stockitem_p.get()]

Date and time: 2020-01-05T12:57:49.618174 Python version: 2.7.17 wxPython version: 3.0.2.0 wxWidgets platform: WXMAC wxGlade version: 0.9.4

DietmarSchwertberger commented 4 years ago

Thanks for reporting.

DUPLICATE is no stock item, only a standard ID: https://docs.wxwidgets.org/stable/defs_8h.html#ac66d0a09761e7d86b2ac0b2e0c6a8cbb

I don't know whether standard IDs have any advantage with dynamic binding. I will change the combo box to a list box to avoid editing

Regards, Dietmar

DietmarSchwertberger commented 4 years ago

released 0.9.5