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

How to align checkbutton in ttk to the left side

I want to configure stylestyle.configure('TCheckbutton', background=theme, foreground='white', anchor=tkinter.W) of tkinter.ttk.Checkbutton to align that checkbutton to the left side, because now it is in a center. Big thanks to every answer :)
Jakub Bláha
  • 1,491
  • 5
  • 22
  • 43
5
votes
1 answer

Connect an Object to an item in a Treeview Widget

I created a ttk/Treeview Widget in Tkinter using Python 3. I would like to connect an object to its name which is listed in the tree view. To illustrate this I created following example. import tkinter as tk from tkinter import ttk class myclass: …
Benjamin
  • 298
  • 1
  • 12
5
votes
4 answers

why does tkinter ttk showing "name ttk is not defined" in python 3.5.1

Consider this simple code: from tkinter import * from tkinter.ttk import * 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…
sujit
  • 185
  • 1
  • 2
  • 9
5
votes
1 answer

Cannot see all tabs in ttk.Notebook

I have some trouble with the tabs from the ttk Notebook class in python 2.7. I cannot see all the tabs I create. I made a minimal code to view the problem: from Tkinter import * import ttk root = Tk() nb = ttk.Notebook(root, width=320,…
Morb
  • 534
  • 3
  • 14
5
votes
3 answers

ttk:Entry widget disabled background color

I have a ttk Entry which is in "disabled" state. The background color of the entry field while disabled is a light blue shade. How can i change it to the default grey color? From this post i understood how we can change the foreground color.…
newbieuser
  • 81
  • 1
  • 2
  • 9
5
votes
2 answers

Create new ttk widget from tkinter

I'm actually trying to create ttk.Spinbox from tkinter.Spinbox. I can manipulate codes below like ttk.Scrollbar pattern. tkinter.Spinbox button gives an old look for my GUI that is why i want to ttk.Spinbox. Edit: I am using Python 3.4 on Windows 7…
Fatih1923
  • 2,665
  • 3
  • 21
  • 28
5
votes
1 answer

Why does tkinter's Entry.xview_moveto fail?

I'm working with tkinter on Python 3.4.1 (Windows 7), and I'm finding that ttk's Entry.xview_moveto function is not working properly. Here is some simple code: from tkinter import * from tkinter import ttk a = Tk() text = StringVar(a,…
Sidnoea
  • 78
  • 6
5
votes
1 answer

Create and use a new ttk::notebook tab style

I know we can modify the default style of a ttk::notebook tab using the following method : ttk::style configure TNotebook.Tab -background red My question is : is it possible to assign a custom style to individual tabs? Bascially, I would like…
user43791
  • 284
  • 2
  • 10
5
votes
1 answer

Why can't I define (and save) Tkinter fonts inside a function?

Defining a font inside a function and in the main body of the script seems to behave differently, and I can't seem to figure out how it's supposed to work. For example, the Label in this example ends up being in a larger font, as expected: from…
Collin
  • 11,977
  • 2
  • 46
  • 60
5
votes
2 answers

Is it possible to change width of notebook tab?

As the title says, I was wondering if it's possible to change the width of a notebook widget tab? What I'm trying to do is to make sure that the tabs are of equal size and fill the entire width of the window even when someone resizes it. Currently,…
Jerry
  • 70,495
  • 13
  • 100
  • 144
5
votes
0 answers

Is there an in depth ttk styling guide available?

So I've begun dabbling with Tkinter as of late, and I have it in my head to create what is essentially an application for storytelling. Ultimately, I'd like stylize most every widget used to conform with some overall aesthetic of my…
5
votes
1 answer

Python tkinter with ttk calendar

I am using this code to create a simple calendar on my Tkinter. When i put a calendar on my main root window, the calendar appear just fine. So, i decided to put another button that will create a Tkinter toplevel window and put 1 more calendar on…
Chris Aung
  • 9,152
  • 33
  • 82
  • 127
5
votes
2 answers

Why ttk Progressbar appears after process in Tkinter

I want to create a large text upon Tkinter menu command and provide visual support by a progress bar. Although the progress bar is meant to start before the subsequent time-consuming loop, the progress bar shows up only after the large text was…
solarisman
  • 256
  • 1
  • 4
  • 16
5
votes
2 answers

How can I display an image in Python 3 using tkinter/ttk?

The nub of the matter is, what am I doing wrong in the following code snippet? from tkinter import * from tkinter.ttk import * root = Tk() myButton = Button(root) myImage = PhotoImage(myButton, file='myPicture.gif') …
Bobble
  • 2,791
  • 4
  • 23
  • 30
4
votes
1 answer

Change padding color of Label widget in ttk / python

I am trying to display an image with ttk/tkinter in python. The image has a white border, and I want to display this image on a larger white background - so it has lots of white space around. For this I use "padx" and "pady" in the label with 100px…
Axel
  • 41
  • 1
  • 2