Comments (9)
I have the same problem under python 3.8, W7 running the table.py example without any change (the example set the 'alt' theme):
Traceback (most recent call last):
table = Table(root, columns=columns, sortable=sortable.get(), drag_cols=drag_col.get(),
File "C:\Python38\lib\site-packages\ttkwidgets\table.py", line 68, in __init__
self._initialize_style()
File "C:\Python38\lib\site-packages\ttkwidgets\table.py", line 122, in _initialize_style
style.map('Table', **style_map)
File "C:\Python38\lib\tkinter\ttk.py", line 403, in map
self.tk.call(self._name, "map", style, *_format_mapdict(kw)),
_tkinter.TclError: Invalid state name d
from ttkwidgets.
I am unable to reproduce this issue on either Windows 10 with Python 3.9.1 or Windows 7 with Python 3.6.6 or Python 3.8.7. From the code, given the error, I would expect that somehow the style map is not formatted properly (particularly, there's a string where there should be a tuple), but I cannot see how this issue can occur with the style_map
.
Is just running the example_table.py
from the master branch without any change on a clean Python environment really sufficient to trigger this exception? Because I can't reproduce this exception when doing that...
from ttkwidgets.
C:\dev\python\ttkwidgets>py -3 -V
Python 3.8.6
C:\dev\python\ttkwidgets>py -3 -m pip check ttkwidgets
No broken requirements found.
C:\dev\python\ttkwidgets>py -3 examples\example_table.py
Traceback (most recent call last):
File "examples\example_table.py", line 22, in <module>
table = Table(root, columns=columns, sortable=sortable.get(), drag_cols=drag_col.get(),
File "C:\Python38\lib\site-packages\ttkwidgets\table.py", line 68, in __init__
self._initialize_style()
File "C:\Python38\lib\site-packages\ttkwidgets\table.py", line 122, in _initialize_style
style.map('Table', **style_map)
File "C:\Python38\lib\tkinter\ttk.py", line 403, in map
self.tk.call(self._name, "map", style, *_format_mapdict(kw)),
_tkinter.TclError: Invalid state name d
ttkwidgets version: 0.11.0
If i comment the line style.theme_use('alt')
the program works.
from ttkwidgets.
This is the background of alt theme map:
'background': [
'disabled', '#d9d9d9', '!disabled !selected', '#ffffff', 'selected', '#4a6984'
]
And this is the native:
'background': [
('disabled','SystemButtonFace'),
('!disabled', '!selected', 'SystemWindow'),
('selected', 'SystemHighlight')
]
from ttkwidgets.
That's most likely an issue on Windows then, as on Linux the style map, even for theme alt
, always looks properly formatted. I am currently not in a position to test it, but I will add it to my todo list. That looks like it will make the parsing more complicated though, and that might even be a bug in Tkinter.
from ttkwidgets.
I think it is a tkinter bug:
tkinter alt Treeview map (Pyhon 3.8):
{
'foreground': [('disabled', '#a3a3a3'), ('!disabled', '!selected', 'black'), ('selected', '#ffffff')],
'background': ['disabled', '#d9d9d9', '!disabled !selected', '#ffffff', 'selected', '#4a6984']
}
Tcl alt Treeview map (Python 3.8):
-foreground {disabled #a3a3a3 {!disabled !selected} black selected #ffffff}
-background {disabled #d9d9d9 {!disabled !selected} #ffffff selected #4a6984}
I think it is more easy to edit the tcl output...
from ttkwidgets.
All right, so I've tried it now on Windows 10 with Python 3.9.1 and Python 3.8.7, and I cannot reproduce this error. The code for _splitdict
, which parses the output of the Tcl command called by style.map()
actually hasn't changed between these versions, so I'm not sure what's going wrong here.
@melassa What sub-versions of Python are using? Are you using the default CPython distributions from python.org
? You are using Windows, right? Python 3.9.1 isn't available for Windows 7, so are you using two different versions of Windows or are you using 3.9.0?
from ttkwidgets.
It was a tkinter bug fixed in 3.8.7 (my bugged version was 3.8.6 under W7). You can close this issue.
from ttkwidgets.
Okay, great that you found the problem!
from ttkwidgets.
Related Issues (20)
- ttkwidgets.Table error .... according to example code
- Overwritten configure methods don't return values
- AutocompleteCombobox has bug when type very quickly.
- Checkbox Treeview Image Replacing Checkbox HOT 2
- Is it possible to insert image along with ttkwidgets CheckboxTreeview
- Is this project alive? HOT 5
- Hooks and validated entries missing from Pypi package HOT 3
- Add screenshots in docs
- Library ttkwidgets==0.12.0 automatically installed under Python 2 HOT 3
- Merging new widgets
- checkboxTreeview: no highlighting row if selected HOT 1
- widgets don't work when using ScrolledFrame.
- Could not resolve import
- About timeline. HOT 1
- [Feature request] Get value range from Scale? HOT 1
- Autocomplete search match with case INSENSITIVE
- askfont - if I select first font type and then the size it don't work. HOT 2
- Change license to GNU LGPL instead of GPL? HOT 1
- Checkbox backgrounds HOT 1
- how to check AutocompleteCombobox is selected for calling a callback function
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ttkwidgets.