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
79
votes
6 answers

What is the difference between the widgets of tkinter and tkinter.ttk in Python?

The main tkinter module and its submodule ttk in Python 3 appear to contain identical widgets (i.e. Buttons, CheckButtons, etc.). So, when creating a button, one has the freedom to either use a tkinter.Button widget or a tkinter.ttk.Button. Do you…
multigoodverse
  • 7,638
  • 19
  • 64
  • 106
56
votes
4 answers

Fresh tutorial on tkinter and ttk for Python 3

Where can I find the most modern tutorial that teaches tkinter together with ttk? Tkinter seems the only way to go in Python 3 (don't suggest Python 2), and ttk gave me hope for good-looking GUI.
Oleh Prypin
  • 33,184
  • 10
  • 89
  • 99
35
votes
3 answers

How to set the min and max height or width of a Frame?

The size of Tkinter windows can be controlled via the following methods: .minsize() .maxsize() .resizable() Are there equivalent ways to control the size of Tkinter or ttk Frames? @Bryan: I changed your frame1.pack code to the…
Malcolm
  • 5,125
  • 10
  • 52
  • 75
33
votes
5 answers

How to create downloading progress bar in ttk?

I want to show a progress bar while downloading a file from the web using the urllib.urlretrive method. How do I use the ttk.Progressbar to do this task? Here is what I have done so far: from tkinter import ttk from tkinter import * root = Tk() pb…
Hanix
  • 333
  • 1
  • 4
  • 4
33
votes
3 answers

When to use pack or grid layouts in tkinter?

Are there any best practice tips regarding when one should use pack vs. grid for their layouts? From what I've been reading via google, the concencus seems to be that grid can handle any pack scenario but not vice-versa. To start the conversation,…
Malcolm
  • 5,125
  • 10
  • 52
  • 75
29
votes
3 answers

tkinter ttk separator won't display

Consider this simple code: from Tkinter import * import ttk root= Tk() ttk.Label(root, text='Heading Here').grid(row=1, column=1) ttk.Separator(root,orient=HORIZONTAL).grid(row=2, columnspan=5) root.mainloop() When I run this code, the separator is…
bhaskarc
  • 9,269
  • 10
  • 65
  • 86
28
votes
7 answers

Matplotlib Crashing tkinter Application

I am building an application that embeds a matplotlib figure into the GUI. The problem is that my app is crashing as soon as I add anything from matplotlib into my code (except for the imports, those work as usual). The problem occurs in my class…
Camon
  • 1,003
  • 1
  • 10
  • 22
26
votes
3 answers

How to know all style options of a ttk widget?

I am without knowledge of tck/tk. I have done carefully search on the internet but haven't found a good solution. For example, I created a LabelFrame using: import tkinter as tk from tkinter import ttk newBT = ttk.LabelFrame(width=100,…
Nan Zhou
  • 1,205
  • 1
  • 13
  • 14
25
votes
3 answers

problems importing ttk from tkinter in python 2.7

I'm working with an example file in a tutorial that asks me to first do two imports: from tkinter import * from tkinter import ttk I get an error. I researched a bit and found that in python 2.7.x I need to capitalize the 't'in tkinter, so I change…
Benjamin Boyce
  • 305
  • 1
  • 4
  • 11
23
votes
1 answer

python ttk.Entry how to center the input

Here is a screenshot of a program I am writing using Python Tkinter. I use ttk.Entry widget to get the user input. I would like to know how to center the input in the Entry (as you can see, the input is now stuck to the left part of the widget)
user12345
  • 407
  • 1
  • 3
  • 10
21
votes
6 answers

How to change the color of ttk button

I am using Python 3.x on Windows. My problem is I want to customize a button widget of ttk by completely changing its background and foreground color. But so far, I have been unsuccessful. My desired button is: I read the ttk.Style guide and used…
maq
  • 1,175
  • 3
  • 17
  • 34
21
votes
5 answers

tkinter optionmenu first option vanishes

A ttk optionmenu widget starts out with all of its values in the dropdown. Upon selecting any value, the first value in the list vanishes, never to reappear... Does anyone know why? Is this a feature of the widget's design? Try it with the…
Tom
  • 371
  • 1
  • 6
  • 16
21
votes
5 answers

Finding the currently selected tab of Ttk Notebook

I have a Ttk Notebook widget containing 8 Frames - so, 8 tabs. Each frame contains a Text widget. I have a button outside the Notebook widget, and I want to insert text into the current tabs Text widget when this button is pressed. This would seem…
Matthew
  • 2,232
  • 4
  • 23
  • 37
21
votes
8 answers

Default window colour Tkinter and hex colour codes

I would like to know the default window colour in Tkinter when you simply create a window: root = Tk() If there is one, it is possible to set widgets to the same colour or use a hex colour code? (using rgb) The colour code I have found for the…
user2063
  • 975
  • 4
  • 15
  • 35
20
votes
4 answers

How to create a tree view with checkboxes in Python

I've been using Tkinter and Tix to write a small program. I'm at a point where I need a tree view with checkboxes (checkbuttons) so I can select items from the tree view. Is there an easy way to do this? I've been looking at ttk.Treeview () and…
user600295
  • 985
  • 3
  • 10
  • 14
1
2 3
76 77