Questions tagged [ttk]

Ttk is the themed widget set for the Tk toolkit, previously known as Tile.

Ttk refers to the themed widgets, originally part of the Tile extension to Tk, which were integrated into Tk, starting with version 8.5.

Ttk aims to separate the code implementing a widget’s behavior from the code implementing its appearance. It includes 17 widgets that use the native look and feel across platforms. Some are very similar to widgets already existing in normal Tk, while others provide new functionality.

Related tags:

  • - the GUI toolkit that Ttk is a part of
  • - questions related to using Tk from Python
  • - questions related to using Tk from Perl

References:

1143 questions
10
votes
2 answers

How to edit the style of a heading in Treeview (Python ttk)

I am trying to use ttk.Treeview to make a sortable table (as per Does tkinter have a table widget? and https://www.daniweb.com/software-development/python/threads/350266/creating-table-in-python). Getting it to work is easy, but I'm having some…
Koen Peters
  • 326
  • 1
  • 2
  • 9
10
votes
2 answers

Simple ttk ComboBox demo

This should be very simple but I am really struggling to get it right. All I need is a simple ttk ComboBox which updates a variable on change of selection. In the example below, I need the value of value_of_combo variable to be updated automatically…
bhaskarc
  • 9,269
  • 10
  • 65
  • 86
9
votes
2 answers

ttk treeview: selected color

The selected row of my ttk treeview shows as a dark blue background with the text white. If I set the color of the row with a tag, for example: self.tree.item(item, tags=('oddrow')) and configure the tag as a color, for…
foosion
  • 7,619
  • 25
  • 65
  • 102
9
votes
5 answers

python ttk treeview: how to select and set focus on a row?

I have a ttk.Treeview widget with some rows of data. How do I set the focus to and select (highlight) a specified item? tree.focus_set() does nothing tree.selection_set(0) complains that: Item 0 not found, although the widget is plainly populated…
foosion
  • 7,619
  • 25
  • 65
  • 102
9
votes
1 answer

How to disable multiselection on Treeview in tkinter

I've a Treeview widget, and I need only one row/item to be selected at a time. I've been reading the doc, but I can't find any property or method to do so, nor I've found something useful on SO. Is it posible? How to?
Btc Sources
  • 1,912
  • 2
  • 30
  • 58
9
votes
2 answers

Questions on using ttk.Style()?

To make available an instance of the ttk.Style() class, it was illustrated in this tkinter guide that the syntax is: import ttk s=ttk.Style() When typing these command in IDLE, I noticed that ttk.Style() actually has a predefined argument,…
Sun Bear
  • 7,594
  • 11
  • 56
  • 102
9
votes
2 answers

How to clear text field part of ttk.Combobox?

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…
Marek
  • 863
  • 4
  • 12
  • 19
9
votes
3 answers

How many/What are the different types of ttk styles available?

I've been making some GUIs recently and found the buttons looked rather bland so I read some tutorials on making the look better using ttk and got the following: from tkinter import ttk from tkinter.ttk import * root = tkinter.Tk() style =…
Inkblot
  • 708
  • 2
  • 8
  • 19
9
votes
3 answers

How to set the background color of a ttk.Combobox

I have a problem to set background color for Combobox using tkinter ttk with 'vista' theme (I'm using Python 3). I've tried code from here ttk.Combobox glitch when state is read-only and out of focus import tkinter as tk from tkinter import…
voldi
  • 423
  • 2
  • 4
  • 10
9
votes
1 answer

How to change the tab of ttk.Notebook

I have a ttk.Notebook and with a button I would like to switch to another tab. How can I achieve this? It looks that changing the tab state (normal, disabled, and hidden) will not solve my problem since I don't want to disable any tabs. Here is my…
Hangon
  • 2,449
  • 7
  • 23
  • 31
9
votes
3 answers

ttk.Treeview - Can't change row height

I'm using ttkcalendar.py which can be found in this link. I've adapted it for use in Python 3.3 Basically what i'm trying to do is enter this calendar widget into my Tkinter application, which works fine and there's no problems there. The problems I…
MistUnleashed
  • 309
  • 1
  • 3
  • 15
9
votes
1 answer

ttk styling "TNotebook.Tab" background and borderwidth not working

I been playing around with TKinter trying to create a multiple tab window. When I try to style the TNotebook.Tab it ignores the options background and borderwidth, but it acknowledges foreground. What am I doing wrong? Here is the relevant part of…
Lex
  • 386
  • 1
  • 4
  • 20
9
votes
1 answer

How do you overlap widgets/frames in python tkinter?

I was wondering if this is even possible. My goal is to have a small white box in the bottom right hand corner, on top of a larger text field. The white box will be used as an "info box" while the person scrolls through the text inside of the text…
user3033423
  • 151
  • 1
  • 2
  • 7
9
votes
4 answers

Tkinter: How to set ttk.Radiobutton activated and get its value?

1) I need to set one of my three ttk.Radiobuttons activated by default when I start my gui app. How do I do it? 2) I also need to check if one of my ttk.Radiobuttons was activated/clicked by the user. How do I do it? rb1 =…
minerals
  • 6,090
  • 17
  • 62
  • 107
8
votes
1 answer

Remove header row in tkinter treeview

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("",…
Tola
  • 254
  • 3
  • 17