ttk

TTK.Progressbar: How to change thickness of a horizontal bar

十年热恋 提交于 2020-06-27 08:52:46
问题 I am using the TTk.Progressbar in my app. I have scoured the net for an answer but no avail. I have the following code which is working well. But I want to change the thickness of the bar. progressbar = ttk.Progressbar(myGui, orient=HORIZONTAL, length=400, mode="determinate", variable=value_progress, ) progressbar.pack() I want the length to still be 400, but from the top of the bar to the bottom, I wish to decrease that so its half or less then half. (I want my bar on a diet, so to say) But

How do I change the border color of a tkinter widget?

谁说胖子不能爱 提交于 2020-06-05 11:37:15
问题 I've been trying to configure the border colour of a widget in Tkinter, and I was wondering how to do that.... I've checked on StackOverflow, and it says that I should use the configure option and then set highlightbackgroundcolor = {insert color here} . I've tried that and nothing has worked. Can someone please show me a working sample of code so I can figure it out? 回答1: There is no way to change the border color of a widget, the border color is tied to the background color of the widget.

How do I change the border color of a tkinter widget?

女生的网名这么多〃 提交于 2020-06-05 11:36:14
问题 I've been trying to configure the border colour of a widget in Tkinter, and I was wondering how to do that.... I've checked on StackOverflow, and it says that I should use the configure option and then set highlightbackgroundcolor = {insert color here} . I've tried that and nothing has worked. Can someone please show me a working sample of code so I can figure it out? 回答1: There is no way to change the border color of a widget, the border color is tied to the background color of the widget.

How do I change the border color of a tkinter widget?

浪子不回头ぞ 提交于 2020-06-05 11:35:02
问题 I've been trying to configure the border colour of a widget in Tkinter, and I was wondering how to do that.... I've checked on StackOverflow, and it says that I should use the configure option and then set highlightbackgroundcolor = {insert color here} . I've tried that and nothing has worked. Can someone please show me a working sample of code so I can figure it out? 回答1: There is no way to change the border color of a widget, the border color is tied to the background color of the widget.

tkinter ttk treeview colored rows

假装没事ソ 提交于 2020-05-14 18:32:49
问题 I am trying to set colors to rows in a tkinter treeview object, using tags and tag_configure. There has been an earlier discussion on coloring rows which is rather old and seems to work no longer for Python3: ttk treeview: alternate row colors I have added a brief example. For me, all rows stay white, independent of whether I execute tag_configure prior or after the insert command. import tkinter as tk import tkinter.ttk as ttk root = tk.Tk() w = tk.Label(root, text="Hello, world!") w.pack()

tkinter ttk treeview colored rows

淺唱寂寞╮ 提交于 2020-05-14 18:31:56
问题 I am trying to set colors to rows in a tkinter treeview object, using tags and tag_configure. There has been an earlier discussion on coloring rows which is rather old and seems to work no longer for Python3: ttk treeview: alternate row colors I have added a brief example. For me, all rows stay white, independent of whether I execute tag_configure prior or after the insert command. import tkinter as tk import tkinter.ttk as ttk root = tk.Tk() w = tk.Label(root, text="Hello, world!") w.pack()

How to clear text field part of ttk.Combobox?

孤人 提交于 2020-05-12 02:45:52
问题 I have a delete function that is supposed to remove the selected item in the Combobox and its associated dictionary value. Then it is supposed to clear the textbox that displays that dictionary value and I would like it to also clear just the text file of the combo box. Is there a way to do that? def DeleteEntry(): if not ComboBox.get() == "" and ComboBox.get() in FriendMap: del FriendMap[ComboBox.get()] FriendListKeys = FriendMap.keys() FriendListKeys.sort() ComboBox['values']=FriendListKeys

How to clear text field part of ttk.Combobox?

隐身守侯 提交于 2020-05-12 02:45:00
问题 I have a delete function that is supposed to remove the selected item in the Combobox and its associated dictionary value. Then it is supposed to clear the textbox that displays that dictionary value and I would like it to also clear just the text file of the combo box. Is there a way to do that? def DeleteEntry(): if not ComboBox.get() == "" and ComboBox.get() in FriendMap: del FriendMap[ComboBox.get()] FriendListKeys = FriendMap.keys() FriendListKeys.sort() ComboBox['values']=FriendListKeys

Remove header row in tkinter treeview

我怕爱的太早我们不能终老 提交于 2020-04-14 19:25:29
问题 Can anyone tell me how to remove the header row in a tkinter Treeview? from tkinter import * from tkinter import ttk root = Tk() NewTree= ttk.Treeview(root) NewTree.pack() NewTree.heading("#0", text="How to remove this row?") NewTree.insert("", "0", 'item1',text='Item number 1') root.mainloop() 回答1: Use the show option to only show the tree and not the heading: NewTree = ttk.Treeview(root, show="tree") Relevant documentation From docs.python.org: show A list containing zero or more of the

How to filter a ttk.treeview in Python?

元气小坏坏 提交于 2020-04-11 04:22:12
问题 I have a python tkinter application that contains a ttk.treeview widget. The widget displays a list of files found on a specific directory tree with a specific extension - this was trivial to build with tt.treeview widget. There is a request to enable "on-the-fly" filtering of the tree - e.g., the user types in an Entry some string, and as he/she types, the tree removes elements that don't match the typed string so far. I was exploring the Treeview documentation, tried the detach and reattach