Category "tkinter"

Why script run only 1 time?

I wrote this code so that when I press on the image this image changes color. The problem is that click works only once; when I click a second time, nothing hap

Python Tkinter: Insert objects into listbox, and then get them out (not as string)

I have a listbox that displays some objects: # extra is some array of 'extra' objects I get from a database self.extrasList = Listbox(self, selectmode='multipl

limit the size of a button with an image

Problem: I want to create my own widget that uses an image in a button, but the image causes the button to be way too big. How can I resize the button to the n

Python help on TKinter

i'm trying to make an brick destroyer game on python with TKinter for my school project, it's barely finished but i have a problem when it's about to break some

How can I align certain elements in Tkinter

Ok let's say I've got a frame. In that frame I've got 2 label frames: Entries and Add/Edit Entry. Add/Edit Entry will always be the same, but Entries is built d

Python tkinter treeview making 2 columns

from Tkinter import Tk, Button import ttk root = Tk() tree = ttk.Treeview(root) tree["columns"]=("one") tree.column("one" ) # tree.column("two", width=100)

How can I add widgets in variable number of rows? (Grid) [closed]

I'm trying to achieve something like this: basically a list containing a variable number of entries, each of one being a frame that contains

How to implement a scrollbar to grid in tkinter

I have a hard time implementing a scrollbar into my Tkinter project. I've been through numerous articles and answered questions on how to implement a scrollbar,

Python - Tkinter not support MacOS Mojave Dark Mode

I have a problem with the support of Dark Mode on MacOS in python Tkinter. I used python 3.6 with ActiveTlc 8.5 and the Dark Mode works fine, the window titleba

How do I delete the selection of a combobox from a sqlite database?

I want to delete a row from a sqlite3 database using the selection of a combobox to get the row that I want to delete. My current code deletes an item from the

Cannot change tkinter font on pixelbook

I am using python3 with tkinter on my pixelbook chromebook using native Linux in developer branch. It's an Anaconda distribution (python 3.6.5), and all packag

MVC with tkinter?

MVC with tkinter? I'm trying to do a simple flashcards game with tkinter with MVC pattern but I do not know how to connect the view with their controller...the

Tkinter - way to open a directory window in Windows Explorer

I've been looking into Tkinter and recently have made a small program just to monitor folders and check how many files are inside. I'de like to create buttons

Making tkinter notebook tabs shrink to fit or adding scrolling to tabs

How can I add scrolling to the tabs of the tkinter notebook? By default notebooks will just expand when more tabs are added but that can lead to errors for apps

How to suppress TASKILL output in python os module

I am trying to create a close button for my tkinter application without using the sys module. I implemented this: os.system("TASKKILL /F /IM main.exe") and con

Why are multiple instances of Tk discouraged?

Consider below example: import tkinter as tk root = tk.Tk() root.title("root") other_window = tk.Tk() other_window.title("other_window") root.mainloop() a

Tkinter/ttk themed Message Box?

I started making a GUI with Tkinter and I added the module tkMessageBox as well. But recently I discovered that importing the module ttk gives more "up-to-date"

How do I execute first my custom error message before the first Traceback?

I made a program with restrictions with Tkinter and I created a custom error message wherein if the conditions for the restriction is met, then an error message

tkFileDialog and Zipfile error: "AttributeError: '_io.TextIOWrapper' object has no attribute 'namelist'"

I'm trying to use tkfiledialog to select a file, and then use Zipfile to extract the contents. from zipfile import ZipFile from tkinter import filedialog Zi

Why does Tkinter image not show up if created in a function?

This code works: import tkinter root = tkinter.Tk() canvas = tkinter.Canvas(root) canvas.grid(row = 0, column = 0) photo = tkinter.PhotoImage(file = './test.g