summaryrefslogtreecommitdiffstats
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorEthan Furman <ethan@stoneleaf.us>2015-07-21 07:54:19 (GMT)
committerEthan Furman <ethan@stoneleaf.us>2015-07-21 07:54:19 (GMT)
commitad1a34197e0d4b890776b8490853d6b9ee38934a (patch)
treec5bf2ff928722809b093d3a8643373bf290ff511 /Lib/tkinter
parent95e0960220cf3bf0d50f52bb4e462acc7b96dcb5 (diff)
downloadcpython-ad1a34197e0d4b890776b8490853d6b9ee38934a.zip
cpython-ad1a34197e0d4b890776b8490853d6b9ee38934a.tar.gz
cpython-ad1a34197e0d4b890776b8490853d6b9ee38934a.tar.bz2
Close issue6549: minor ttk.Style fixes
Diffstat (limited to 'Lib/tkinter')
-rw-r--r--Lib/tkinter/ttk.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py
index b9c57ad..bad9596 100644
--- a/Lib/tkinter/ttk.py
+++ b/Lib/tkinter/ttk.py
@@ -381,7 +381,9 @@ class Style(object):
a sequence identifying the value for that option."""
if query_opt is not None:
kw[query_opt] = None
- return _val_or_dict(self.tk, kw, self._name, "configure", style)
+ result = _val_or_dict(self.tk, kw, self._name, "configure", style)
+ if result or query_opt:
+ return result
def map(self, style, query_opt=None, **kw):
@@ -466,12 +468,14 @@ class Style(object):
def element_names(self):
"""Returns the list of elements defined in the current theme."""
- return self.tk.splitlist(self.tk.call(self._name, "element", "names"))
+ return tuple(n.lstrip('-') for n in self.tk.splitlist(
+ self.tk.call(self._name, "element", "names")))
def element_options(self, elementname):
"""Return the list of elementname's options."""
- return self.tk.splitlist(self.tk.call(self._name, "element", "options", elementname))
+ return tuple(o.lstrip('-') for o in self.tk.splitlist(
+ self.tk.call(self._name, "element", "options", elementname)))
def theme_create(self, themename, parent=None, settings=None):