treeview

Tkinter Treeview has an index column too wide, and it cannot be resized

Tkinter Treeview has an index column too wide, and it cannot be resized Question: I’ve been working on a Tkinter app for a while, and a part of it is a Treeview widget that displays data. I managed to mash up some code I found because I have almost zero experience with Treeview, and it …

Total answers: 1

How to add and remove individual tkk.Treeview tags using "addtag" and "dtag"?

How to add and remove individual tkk.Treeview tags using "addtag" and "dtag"? Question: I have been trying to add and remove individual tags from items in a ttk.Treeview (tkinter). I have seen references to addtag and dtag (dtag deletes specified tags leaving unspecified remaining) but the only examples I can find are related to canvas …

Total answers: 1

How to cancel a tkinter key bind event

How to cancel a tkinter key bind event Question: I have a tkinter treeview. I am responding to a click on an item. If the item is not unique i want to cancel the selection and stay on the current item. The code I am using is: def select_item(self, event, *args) -> None: item = …

Total answers: 1

Tkinter treeview selection of mutiple rows and retrieve the selected rows

Tkinter treeview selection of mutiple rows and retrieve the selected rows Question: I am using the sample Treeview widget for the user to select the multiple rows. I used the tree.selection method for this in the code. However, I am unable to figure out a better approach to retrieve the selected rows in an appropriate …

Total answers: 1

selecting mutliple items in python Tkinter Treeview with mouse event Button-1

selecting mutliple items in python Tkinter Treeview with mouse event Button-1 Question: I looked for and tested many similar questions/answers/possible duplicates here on SO and other sites but I’m interested specifically in using the solution below for simplicity’s sake and minimal reproducible example constraint satisfaction. Why does the following modification of this previous answer’s code …

Total answers: 2

Method in one Python Treeview Class to affect instance of different Treeview class

Method in one Python Treeview Class to affect instance of different Treeview class Question: My Python program has two classes that are basically modified versions of Tkinter’s Treeview Widget. The reason for the two different classes is that they have different methods for when items within them are double-clicked, selected etc. The program creates an …

Total answers: 1

How to refresh tkinter Threeview for the height of heading

How to refresh tkinter Threeview for the height of heading Question: Try to set heading of Treeview to 3-line height. Following code to demo this issue. import tkinter as tk from tkinter import ttk from tkinter.font import Font root = tk.Tk() font = (‘Courier New’, 10) tkfont = Font(family=font[0], size=font[1]) width, height = tkfont.measure(‘W’), tkfont.metrics("linespace") …

Total answers: 1

Display data from a Django model as a Tree view

Display data from a Django model as a Tree view Question: I have a Django model as shown below class operationTemplates(models. Model): templateID = models.IntegerField(primary_key = True) templateCategory = models.CharField(max_length=255, blank=True, null=True) templateName = models.CharField(max_length=400, blank=True, null=True) templatePreopBundle = models.CharField(max_length=255, blank=True, null=True) templatePosition = models.CharField(max_length=20, blank=True, null=True) I want to display the data as a …

Total answers: 2