robertlugg / easygui

easygui for Python
http://easygui.readthedocs.org/en/master/
BSD 3-Clause "New" or "Revised" License
455 stars 114 forks source link

button box msg getter throws error if message was not previously set. #151

Open spyoungtech opened 6 years ago

spyoungtech commented 6 years ago
>>> box = eg.buttonbox('Test!', run=False)
>>> box.msg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "\easygui\boxes\button_box.py", line 182, in msg
    return self._msg
AttributeError: 'ButtonBox' object has no attribute '_msg'

To avoid this, the _msg attribute should ideally be set in the BottonBox's __init__ method.

zadacka commented 6 years ago

@spyoungtech - yep, I'd agree with your assessent! I've got a work-in-progress refactor on a branch which would do this, but it is incomplete. If you'd like to submit a patch request for this specific change in the meantime we could get it in sooner? Alternatively we can leave this open until I get around to finishing the refactor and fixing this.