New submission from Serhiy Storchaka:
For now methods selection_set(), selection_add(), selection_remove() and
selection_toggle() of ttk.TreeView take the single argument that should be
either the single item id or a tuple or list of item ids. In contrary methods
delete() and detach() take item ids as a variable number of arguments. The
latter interface looks more pythonic, more consistent and errorproof.
Proposed patch (based on Terry's suggestion in issue26386) makes selection
methods accepting a variable number of arguments. For compatibility with older
versions a tuple or list of item ids can be specified as a single argument, but
this interface is deprecated (with long deprecation period).
In addition deprecated other weird interface. For now the selection() method
can take a subcommand name and items, for example tv.selection('add', 'ITEM1').
If the first argument is None, arguments are ignored, tv.selection(None,
'spam') equals to tv.selection(). Now all this is deprecated and will be
TypeError in 3.7.
----------
components: Library (Lib), Tkinter
files: treeview_selection_items.patch
keywords: patch
messages: 268574
nosy: serhiy.storchaka, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: Multiple item arguments for selection operations
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file43390/treeview_selection_items.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue27319>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com