jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
613 stars 68 forks source link

Built-in Property functions not working in ttk mode #546

Closed jarvisteach closed 6 years ago

jarvisteach commented 6 years ago

Certain properties fail, when appJar is run in ttk mode

from appJar import gui 

with gui('ttk demo', useTtk=True) as app:
    with app.labelFrame('lf1', bg='red'):
        app.label('hello world', bg='red')

Gives:

2018-10-20 07:19:29,459 appJar:ERROR [Line 26->1750/__exit__]: ContextManager failed: Creating new attributes is not allowed!
Traceback (most recent call last):
  File "issue542.py", line 18, in <module>
    with app.tab("HW", bg="slategrey", sticky="news"):
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "../../appJar/appjar.py", line 4867, in tab
    self.configure(**kwargs)
  File "../../appJar/appjar.py", line 2541, in configure
    if bg is not None: self.bg = bg
  File "../../appJar/appjar.py", line 5783, in __setattr__
    raise AttributeError("Creating new attributes is not allowed!")
AttributeError: Creating new attributes is not allowed!
jarvisteach commented 6 years ago

This is probably to do with certain properties (like bg) not being supported in ttk mode.