Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7a025823
Commit
7a025823
authored
Nov 07, 2014
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #22769: Fixed ttk.Treeview.tag_has() when called without arguments.
parent
a6a8a4f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
1 deletion
+23
-1
Lib/lib-tk/test/test_ttk/test_widgets.py
Lib/lib-tk/test/test_ttk/test_widgets.py
+16
-0
Lib/lib-tk/ttk.py
Lib/lib-tk/ttk.py
+5
-1
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Lib/lib-tk/test/test_ttk/test_widgets.py
View file @
7a025823
import
unittest
import
Tkinter
as
tkinter
from
Tkinter
import
TclError
import
ttk
from
test.test_support
import
requires
,
run_unittest
import
sys
...
...
@@ -1564,6 +1565,21 @@ class TreeviewTest(AbstractWidgetTest, unittest.TestCase):
'blue'
)
self
.
assertIsInstance
(
self
.
tv
.
tag_configure
(
'test'
),
dict
)
def
test_tag_has
(
self
):
item1
=
self
.
tv
.
insert
(
''
,
'end'
,
text
=
'Item 1'
,
tags
=
[
'tag1'
])
item2
=
self
.
tv
.
insert
(
''
,
'end'
,
text
=
'Item 2'
,
tags
=
[
'tag2'
])
self
.
assertRaises
(
TypeError
,
self
.
tv
.
tag_has
)
self
.
assertRaises
(
TclError
,
self
.
tv
.
tag_has
,
'tag1'
,
'non-existing'
)
self
.
assertTrue
(
self
.
tv
.
tag_has
(
'tag1'
,
item1
))
self
.
assertFalse
(
self
.
tv
.
tag_has
(
'tag1'
,
item2
))
self
.
assertFalse
(
self
.
tv
.
tag_has
(
'tag2'
,
item1
))
self
.
assertTrue
(
self
.
tv
.
tag_has
(
'tag2'
,
item2
))
self
.
assertFalse
(
self
.
tv
.
tag_has
(
'tag3'
,
item1
))
self
.
assertFalse
(
self
.
tv
.
tag_has
(
'tag3'
,
item2
))
self
.
assertEqual
(
self
.
tv
.
tag_has
(
'tag1'
),
(
item1
,))
self
.
assertEqual
(
self
.
tv
.
tag_has
(
'tag2'
),
(
item2
,))
self
.
assertEqual
(
self
.
tv
.
tag_has
(
'tag3'
),
())
@
add_standard_options
(
StandardTtkOptionsTests
)
class
SeparatorTest
(
AbstractWidgetTest
,
unittest
.
TestCase
):
...
...
Lib/lib-tk/ttk.py
View file @
7a025823
...
...
@@ -1458,7 +1458,11 @@ class Treeview(Widget, Tkinter.XView, Tkinter.YView):
all items which have the specified tag.
* Availability: Tk 8.6"""
return
self
.
tk
.
getboolean
(
if
item
is
None
:
return
self
.
tk
.
splitlist
(
self
.
tk
.
call
(
self
.
_w
,
"tag"
,
"has"
,
tagname
))
else
:
return
self
.
tk
.
getboolean
(
self
.
tk
.
call
(
self
.
_w
,
"tag"
,
"has"
,
tagname
,
item
))
...
...
Misc/NEWS
View file @
7a025823
...
...
@@ -37,6 +37,8 @@ Core and Builtins
Library
-------
-
Issue
#
22769
:
Fixed
ttk
.
Treeview
.
tag_has
()
when
called
without
arguments
.
-
Issue
#
22787
:
Allow
the
keyfile
argument
of
SSLContext
.
load_cert_chain
to
be
None
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment