question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: Add "deselect_path" to TreeView widget

See original GitHub issue

Currently, TreeView widget has a select_path() method but no public API to de-select, except to clear the whole tree. I propose a new method named deselect_path(). In Qt, it is simply the opposite of select_path(), as follows:

class TreeView(...):

    def select_path(self, path):
        item = self._path_to_item(path)
        item.setSelected(True)

    def deselect_path(self, path):
        item = self._path_to_item(path)
        item.setSelected(False)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ejeschkecommented, Aug 8, 2017

I think between the two that you show, I’d prefer reusing select_path. The reason is that it makes the code simpler in cases where you want to calculate selections–you don’t end up having to write conditional branches or use first-class functions to choose a different method. Instead it just changes the state kwarg, which seems more readable to me.

0reactions
pllimcommented, Aug 8, 2017

this would actually just deselect the one row out of many?

Yes. I have many rows selected but then I want to only de-select one of them. I use this feature in MosaicAuto plugin in stginga.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature request: tree view in open editors · Issue #81544
I would like to add that this would be an amazing tool to stay organized while working on VS Code. One of the...
Read more >
TkDocs Tutorial - Treeview
A treeview widget displays a hierarchy of items and allows users to browse through it. One or more attributes of each item can...
Read more >
Tkinter TreeView Widget - AskPython
The TreeView widget is very useful if you want to display a hierarchy of items, ... You can dynamically add or remove nodes...
Read more >
Python Tkinter GUI Tutorial #117 - YouTube
In this video we'll learn more about the Tkinter Treeview. I'll show you how to add items, remove individually selected items, remove all ......
Read more >
45. ttk.Treeview
Treeview widget is to present a hierarchical structure so that the user can use ... This means each call to the .insert() method...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found