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

tk.call( _tkinter.TclError: unknown option "-bg"

I want to set a theme to my tkinter window as well as config my tkinter window buttons, labels with options like bg. Following is my approach, Imports, from tkinter import * import tkinter as tk from tkinter import ttk from ttkthemes import…
TUSHAR BAPECHA
  • 123
  • 1
  • 2
  • 8
6
votes
2 answers

tkinter ttk treeview colored rows

I am trying to set colors to rows in a tkinter treeview object, using tags and tag_configure. There has been an earlier discussion on coloring rows which is rather old and seems to work no longer for Python3: ttk treeview: alternate row colors I…
tfv
  • 6,016
  • 4
  • 36
  • 67
6
votes
2 answers

ttk tkinter multiple frames/windows

The following application I have created is used to demonstrate multiple windows in tkinter. The main problem is that none of the Entry controls, neither in the bmi-calculator or the converter, accept the values in the entry boxes - they get a…
py_tk_coder
  • 151
  • 1
  • 1
  • 4
6
votes
1 answer

Python Tkinter: Binding Keypress Event to Active Tab in ttk.Notebook

Summary In a Python Tkinter application, when using ttk.Notebook, how do I bind a keypress event so that it only fires when the tab containing the frame generating the event is active (i.e., for a button hotkey, how do I only capture the event while…
Deacon
  • 3,615
  • 2
  • 31
  • 52
6
votes
5 answers

How to disable manual resizing of Tkinter's Treeview column?

Since I can't horizontally scroll Treeview column due to what appears to be Tk/Tkinter limitation, I want to make it sticky so it is attached to the frame. The issue is that user can manually resize Treeview column which can mess up my interface in…
Doom8890
  • 435
  • 3
  • 15
6
votes
2 answers

How to filter a ttk.treeview in Python?

I have a python tkinter application that contains a ttk.treeview widget. The widget displays a list of files found on a specific directory tree with a specific extension - this was trivial to build with tt.treeview widget. There is a request to…
NirMH
  • 4,769
  • 3
  • 44
  • 69
6
votes
1 answer

ttk Opening Secondary Window when Applying Style

Here is my code from Tkinter import * import ttk, tkMessageBox import os font = ("Avenir", 24) b = ttk.Style() b.configure('TButton', font=font) class LoginScreen(Tk): def __init__(self, *args, **kwargs): Tk.__init__(self, *args,…
Max O
  • 63
  • 3
6
votes
2 answers

Get combobox value in python

I'm developing an easy program and I need to get the value from a Combobox. It is easy when the Combobox is in the first created window but for example if I have two windows and the Combobox is in the second, I am not able read the value from…
Damien
  • 921
  • 4
  • 13
  • 31
6
votes
4 answers

Create resizable/multiline Tkinter/ttk Labels with word wrap

Is it possible to create a multi-line label with word wrap that resizes in sync with the width of its parent? In other words the wordwrap behavior of Notepad as you change the width of the NotePad window. The use case is a dialog that needs to…
Malcolm
  • 5,125
  • 10
  • 52
  • 75
6
votes
1 answer

Python 2.7/Windows: How to control position of Tkinter common dialogs?

Python 2.7 under Windows: How can we control the position of Tkinter's common dialogs? Here's what we've discovered: Certain common dialogs always open up relative to their parent window Certain common dialogs always open up centered on the user's…
Malcolm
  • 5,125
  • 10
  • 52
  • 75
6
votes
1 answer

How to hide ttk Treeitem indicators in a Python GUI

I'm building a Python GUI application using ttk treeviews. On Linux, when a Treeitem has child items, it displays an arrow to show that the row can be expanded. I want to hide this indicator arrow (I am using other ways to hint that the row can be…
Zeke
  • 1,974
  • 18
  • 33
6
votes
0 answers

Styling ttk button borders

I'm trying to figure out how to style ttk buttons from Python (ttk.Button) on Linux, and right now I'm focusing on the border. All of the built-in themes (alt, clam, classic, and default) appear to use the Button.border element, but they list…
Uyghur Lives Matter
  • 18,820
  • 42
  • 108
  • 144
6
votes
3 answers

How can I ensure my ttk.Entry's invalid state isn't cleared when it loses focus?

I would like to set or clear the invalid state flag of a ttk.Entry whenever the contents change. I'm doing this by connecting a StringVar to the entry, and in a trace() callback, calling state(['valid']) or state(['!invalid']). The flag is correctly…
Dan Getz
  • 8,774
  • 6
  • 30
  • 64
6
votes
2 answers

Python: Focus on ttk.Notebook tabs

I haven't figured out how to set the focus on a specific tab of a ttk.Notebook. focus_set does not work. Is there any possibility? Thanks in advance
dolby
  • 643
  • 1
  • 8
  • 10
6
votes
2 answers

Python ttk.combobox force post/open

I am trying to extend the ttk combobox class to allow autosuggestion. the code I have far works well, but I would like to get it to show the dropdown once some text has been entered without removing focus from the entry part of the widget. The part…
James Kent
  • 5,763
  • 26
  • 50