4/30/2024 0 Comments Python tkinter treeview focus![]() But if I use a Python linked with Tk 8.6.9, the bars are not colored. 3 installers which use Tk 8.6.8, the colors are displayed. The difference in behavior appears to be due to a change in Tk. Tree.tag_configure ("B", foreground="red") Tree.tag_configure ("A", foreground="black") #Py 3.7.3: no effect Tree = ttk.Treeview (root, columns=('Data')) nfigure ("Treeview", foreground="yellow", background="grey", fieldbackground="green") Treeview difference between Python v3.7.2 and v3.7.3Ĭolor change with Treeview does not work in Python 3.7.3, (I noticed this because a testcase was failing on other branches but not 2.7 although the tests are virtually identical.) PR 12014 fixes this.PySimpleGUI, gpolo, guillaumeb, mrabarnett, ned.deily, serhiy.storchaka, terry.reedyĬreated on 08:31 by guillaumeb, last changed 14:59 by admin. It looks like some testing code was inadvertently committed in the 2.7 branch fix causing only the Treeview testcases to be executed when test_ttk_gui_only is run. New changeset 72ff2f7554e550762acaad805a8a0d456a29468a by Ned Deily in branch '2.7':īpo-26386: Re-enable missing widget testcases in test_ttk_guionly. Opened issue27319 for changing the signature of selection methods. New changeset ac7c10f5e36e by Serhiy Storchaka in branch '2.7': New changeset d1c0bc1d0625 by Serhiy Storchaka in branch 'default': Issue #26386: Fixed ttk.TreeView selection operations with item id's New changeset 0885477fecfd by Serhiy Storchaka in branch '3.5': Items = items0 # or more processing if lists were allowed "rather than as multiple items is deprecated and " "The option of passing multiple items as a tuple " If not isinstance(items, isinstance(str)): If len(items) = 1: # Remove after deprecation. For 4 derivatives, 'See selection.' In the code, instead add (untested): "For back compatibility, one may also pass a single tuple (or list?) of items." and Version Changed. For selection (list the 4 selops and) add a note. That will automatically make a single string become a len 1 tuple. LGTM, but after applying to all 3, leave open (or open new issue) to replace patch in 3.6 (before beta 1).Ĭhange signature to *items. """If selop is not specified, returns selected items."""Īuthor: Serhiy Storchaka (serhiy.storchaka) *īut I like the idea to make the selection_*() methods conforming with the delete() and detach() methods in 3.6. selectionĭef selection(self, selop=None, items=None): ![]() My suggested fix is to add a statement to. Putting a single string in a tuple solves the problem, as in. This should have been the signature of the selection methods. The methods them pass the tuple of strings to tk. detach methods have signature '*items', meaning that each item is passed as a separate argument. ![]() The unofficial but generally helpful doc, says "The argument may be either a single iid or a sequence of iids." I would expect sequence mean a tuple of strings, not space-separated fields in a string (a tcl sequence). The doc string and doc do not define the form of 'items'. These are the only Treeview methods in which a single argument can be multiple items. Return self.tk.call(self._w, "selection", selop, items) Tree.insert('', 1, iid='a b', text='id with space')įile "F:\Python\mypy\tem.py", line 10, in įile "C:\Programs\Python35\lib\ tkinter\ttk.py", line 1415, in selection_toggleįile "C:\Programs\Python35\lib\ tkinter\ttk.py", line 1395, in selection ![]() selection_xyz(items) methods, which are all specializations of the. (IDLE displays TkVersion in Help => About IDLE.) However, on Win 10 (8.6.4), I was able to reproduce with all four of the. It is generally a good idea to mention OS, OS version, and Tk Version. A traceback is not a crash for the purpose of this tracker. Note that so far all other places in dealing with the item id's have no issue when there are spaces in them. These two lines of workaround code do work however. Traceback line numbers are 1415 then 1395Įither of these lines of code, where the item id is "2009 Report.pdf" crash Id's with spaces in them causes a crash when using the. Gbarnabic, ned.deily, python-dev, serhiy.storchaka, terry.reedyĬreated on 16:30 by gbarnabic, last changed 14:58 by admin.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |