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
19
votes
2 answers

How to make a ttk.Combobox callback

I was wondering if there was a way to invoke a call back from a ttk.Combobox when the user selects an item from the drop-down list. I want to check to see what the value of the combobox is when an item is clicked so that I can display the associated…
Marek
  • 863
  • 4
  • 12
  • 19
18
votes
8 answers

How to make ttk.Treeview's rows editable?

Is there any way to use ttk Treeview with editable rows? I mean it should work more like a table. For example on double click on the item make the #0 column 'editable'. If this isn't possible, any way to allow mouse selecting on the item would…
dakov
  • 1,039
  • 2
  • 12
  • 33
17
votes
6 answers

ttk treeview: alternate row colors

How can I set a style for treeview widgets so that alternate rows have different background colors, for example, rows 1,3,5 have white backgrounds and rows 2,4,6 have light blue-grey backgrounds? I'd also like to set gridlines.
foosion
  • 7,619
  • 25
  • 65
  • 102
17
votes
3 answers

Set a default value for a ttk Combobox

I'm using Python 3.2.1 in Arch Linux x86_64. This one is really driving me crazy: I just want to have a default, preselected value for a ttk.Combobox as soon as I grid it. This is my code: from tkinter import Tk, StringVar, ttk root = Tk() def…
kynikos
  • 1,152
  • 4
  • 14
  • 25
16
votes
4 answers

How to change ttk.progressBar color in python

Does anyone know how I can change the color of my ttk.progressBar? It now shows a green color, and I would love to have it blue. import ttk self.progressBar = ttk.Progressbar(frame3, length=560, maximum=100,…
Coryza
  • 231
  • 1
  • 3
  • 12
16
votes
2 answers

Expandable and contracting frame in Tkinter

Does anyone know if there is already a widget/class to handle expanding/contracting a frame based on a toggled button (checkbutton) in tkinter/ttk? This question stems from my attempt to clean up a cluttered gui that has lots of options categorized…
Onlyjus
  • 5,799
  • 5
  • 30
  • 42
15
votes
4 answers

Changing the appearance of a Scrollbar in tkinter (using ttk styles)

I was wondering if you could help me with a style options issue in ttk. I've managed to change most of the basic ttk widgets to the style of my preference. I'm only stuck at changing the style of a scrollbar. I've searched for hours looking for an…
StephanL
  • 151
  • 1
  • 1
  • 5
15
votes
3 answers

Horizontal scrolling won't activate for ttk Treeview widget

I'm using the ttk Treeview widget to implement a folder/path selection dialog. It's all working as expected except that my horizontal scrollbar won't activate. No matter how wide the folder path goes horizontally, and no matter how narrow the…
JDM
  • 1,709
  • 3
  • 25
  • 48
14
votes
5 answers

Changing ttk Button Height in Python

This seems like a silly question, but is it possible to change the height of a ttk button manually? Something like button = tkinter.Button(frame, text='hi', width=20, height=20...) works just fine for a tkinter button. Though I'd prefer to use a…
user1301039
  • 143
  • 1
  • 1
  • 5
14
votes
5 answers

Remove empty first column of a Treeview object

I'm trying to make a program that retrieves records from a database using sqlite3, and then display them using a Treeview. I succeeded in having a table created with the records, but I just can't remove the first empty column. def…
Ashish Gaurav
  • 265
  • 1
  • 2
  • 11
14
votes
1 answer

How to set a Tkinter widget to a monospaced, platform independent font?

It's said here in the section Standard Fonts: Particularly for more-or-less standard user interface elements, each platform defines specific fonts that should be used. Tk encapsulates many of these into a standard set of fonts that are always…
z33k
  • 3,280
  • 6
  • 24
  • 38
14
votes
3 answers

Tkinter/ttk themed Message Box?

I started making a GUI with Tkinter and I added the module tkMessageBox as well. But recently I discovered that importing the module ttk gives more "up-to-date" results: buttons and texts boxes appear with the actual style of the current OS. This…
Xesa
  • 153
  • 1
  • 1
  • 5
14
votes
5 answers

Tkinter look (theme) in Linux

I know that Tkinter is not so modern, not so cool and maybe better to use PyQt or etc. But it is interesting for me can Tkinter look not so ugly in Ubuntu (Linux). Looks that brew version (in OS X) of python's Tkinter compiled with built-in theme…
ipeacocks
  • 2,187
  • 3
  • 32
  • 47
14
votes
1 answer

Python tkinter ttk one radio button appears the wrong size

I'm using Tkinter ttk radio buttons, and have a peculiar issue. The last radio button created appears larger than the others at first. Once the mouse is placed over it, it snaps to the right size. The issue looks like this: And this is the code…
gfrung4
  • 1,658
  • 3
  • 14
  • 22
14
votes
3 answers

Removing Ttk Notebook Tab Dashed Line

I'm trying to make a tkinter app that doesn't look like a tkinter app. I'm using a ttk Notebook, and the tabs have this little dotted line around the text when they're selected. It looks terrible, and I can't find a way to remove it using either…
jstaab
  • 3,449
  • 1
  • 27
  • 40
1
2
3
76 77