ttk

Can I put a padding between the checkbox and the label in Radiobutton from tkinter?

tkinter ttk Radiobutton layout – apply padding between indicator and label Question: Is it possible to add a padding between Radiobutton’s label and the checkbox? For example I want to move "Option 1" and "Option 2" texts to lower from their checkboxes: screen = Tk() canvas = Canvas(screen, width=600, height=600) canvas.pack() s = ttk.Style() s.layout(‘TRadiobutton’, …

Total answers: 1

Tkinter – TTK – Button change state after click

Tkinter – TTK – Button change state after click Question: how can i change the state of a button made with TTK in Python after i clicked it ? I want to disable the button START after i press it once and re-enable it after pressing STOP. I want this because my code creates a …

Total answers: 1

Tkinter: ttk.Label displaying nothing when given StringVar as textvariable, inside a class

Tkinter: ttk.Label displaying nothing when given StringVar as textvariable, inside a class Question: I am trying to use the textvariable attribute of ttk.Label to display & update text according to a given StringVar. from tkinter import * from tkinter import ttk class RenderEvent(): def __init__(self, root): self.root = root self.frame = ttk.Frame(self.root, padding="20 20 20 …

Total answers: 1

Why is there a dash in ttk radio button when made with a function?

Why is there a dash in ttk radio button when made with a function? Question: When I make two sets of the same radio buttons there will be a dash in one of the buttons created from a function. import tkinter as tk from tkinter import ttk def add_radio_buttons(): a_b = tk.StringVar() a_button = ttk.Radiobutton(window, …

Total answers: 1

How to set focus with multiple class instances for key binding python tkinter

How to set focus with multiple class instances for key binding python tkinter Question: What am I doing wrong in python focus for binding? I’m trying to bind the button widget to keyboard enter and nothing happens, or the focus ends on the last instance of the class to be loaded. I added self.bind(‘<Return>’, lambda …

Total answers: 1

Using ttk theme azure-dark and Changing background color of ttk combobox widget

Using ttk theme azure-dark and Changing background color of ttk combobox widget Question: I am using the ttk azure theme dark Azure-ttk-theme. It sets the background color to nice modern looking UI. However, as seen in the images the background color of the tk window, Text widget and combobox widget is set as same. This …

Total answers: 2

TreeView in tkinter freez while updating

TreeView in tkinter freez while updating Question: I am trying to update a treeview every second from a database with clients and ping time status, if the successful ping was before some:X time the row will be red(or odd red to distinguish). update_tree always is running with and sleeping 1 sec between each loop. Also …

Total answers: 1

how to show/hide widget in tkinter without moving other widget

how to show/hide widget in tkinter without moving other widget Question: I’m using grid_remove() and grid() command to hide/show the widget but the result is the other widget is move out of the original position. How to hide/show the widget without moving widget Example: from tkinter import * from tkinter import ttk GUI = Tk() …

Total answers: 1

How to insert text string into ttk Entry?

How to insert text string into ttk Entry? Question: I want to add/delete a string to ttk Entry. How? I’m new in tkinter Entry but I don’t know how in ttk Entry. This is code to insert any string in tkinter Entry: from tkinter import * root = Tk() my_entry = Entry(root,font=("arial",10,"bold")).pack() my_entry.insert(0, "GG") # …

Total answers: 1

How to convert .exe file to windows setup wizard

How to convert .exe file to windows setup wizard Question: 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 …

Total answers: 2