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
6
votes
1 answer

Tkinter: ProgressBar with indeterminate duration

I would like to implement a progress bar in Tkinter which fulfills the following requirements: The progress bar is the only element within the main window It can be started by a start command without the need of pressing any button It is able to…
Rickson
  • 1,040
  • 2
  • 16
  • 40
6
votes
1 answer

Expand/collapse ttk Treeview branch

I would like to know the command for collapsing and expanding a branch in ttk.Treeview. Here is a minimalistic example code: #! coding=utf-8 import tkinter as tk from tkinter import ttk root = tk.Tk() tree =…
throwaway17434
  • 821
  • 3
  • 13
  • 22
6
votes
2 answers

Python Tkinter wrap widgets in frame if they reach the end of the screen

Is there something like pack to new line for Tk geometry manager? I am using pack to put widgets inside of a frame. On a high resolution screen, the widgets fit find side by side. However, if you put it into a smaller screen, the widgets will run…
jwillis0720
  • 4,329
  • 8
  • 41
  • 74
6
votes
2 answers

ttk.Combobox glitch when state is read-only and out of focus

When a ttk.Combobox is read-only and not in focus, its text background gets white which differs from the gray field background and makes the combobox look ugly: The desired style would be the second one's. How to make a combobox work like that?
SzieberthAdam
  • 3,999
  • 2
  • 23
  • 31
6
votes
2 answers

Tkinter insert a Combobox inside a Treeview widget

For example, lets create a Treeview widget using a class as follows: class FiltersTree: def __init__(self, master, filters): self.master = master self.filters = filters self.treeFrame = Frame(self.master) …
ADB
  • 1,210
  • 4
  • 15
  • 23
6
votes
2 answers

Changing ttk widget text color

I've searched all over, but have yet to find a simple example showing how to change a minor element of a ttk widget style and applying it dynamically (after widget creation). I have some ttk checkbuttons representing some configuration items, and a…
BobC
  • 1,978
  • 3
  • 24
  • 26
6
votes
1 answer

Python & ttk Using labelFrames to clean up a frame

I'm trying to build a basic GUI using ttk / Tkinter. I have a plotted out a basic GUI that has the right basic components, but when I try and prettify it / space it out, I'm reach my limit of getting ttk containers to play nicely... Examples: from…
Jay Gattuso
  • 3,890
  • 12
  • 37
  • 51
6
votes
1 answer

Why does my ttk.Treeview click handler return the wrong item on tree.focus()?

I have a simple script using a ttk.Treeview instance that I'm populating with the contents of a file system tree. I want to perform a certain operation when (leaf) items are clicked so I configured a handler like so: self.tree.tag_bind('#entry',…
scorpiodawg
  • 5,612
  • 3
  • 42
  • 62
6
votes
2 answers

Is there a way to set tabs of a Notebook below one another?

So far when using the ttk.Notebook widget, but I am unable to set tabs below one another, they keep piling up eastward. Is there a way to set them to stack somehow?
tSs
  • 125
  • 3
  • 9
6
votes
1 answer

Combining grid/pack Tkinter

I know there have been many questions on grid and pack in the past but I just don't understand how to combine the two as I'm having difficulties expanding my 'table' in both directions (row/column). Buttons I wish to keep the same size but always…
user2063
  • 975
  • 4
  • 15
  • 35
5
votes
1 answer

Where are the tk style customization saved/stored?

Take this very simple code sample: import tkinter as tk from tkinter import ttk root = tk.Tk() s = ttk.Style() s.theme_use('vista') s.map("Mod.TCombobox",fieldbackground=[('readonly', 'red')]) Can you tell me where the Mod.TCombobox…
danicotra
  • 1,333
  • 2
  • 15
  • 34
5
votes
2 answers

How to convert .exe file to windows setup wizard

I was creating an app through Tkinter. And after making I converted into .exe file using pyinstaller. It is good but I want to make it more professional. Like when we download any application from internet and open it it opens a setup wizard with…
Binamra
  • 164
  • 1
  • 9
5
votes
1 answer

tkinter ttk style Layout not found

Getting an error on the following code. Keep looking at examples and re-evaluating code but cannot really spot any reason this shouldn't run. Is there anything incorrect such that the 'mRRed' layout cannot be found? (And I'm sure the…
Chemistpp
  • 2,006
  • 2
  • 28
  • 48
5
votes
3 answers

How to change ttk button background and foreground when hover it in tkinter

I'm trying to change ttk.tkinter button background to black and foreground colour to white when mouse is hover it. Have tried highlightbackground and activebackground but doesn't yield the result I'm looking for. import tkinter as tk import…
O JOE
  • 587
  • 2
  • 17
  • 31
5
votes
0 answers

Is it possible to scroll Treeview's column content, not column window in Tkinter?

I have a window with Treeview widget and a column. If I add enough nodes so that node's text extends beyond window's width, it'll not be possible to scroll horizontally unless I change column width to make it wider than the window width. Here's what…
Doom8890
  • 435
  • 3
  • 15