Skip to content
Advertisement

Tag: tkinter

Making child class inherit methods from parent in tkinter

I’m new to Tkinter and OOP. I’ve been trying to make child class inherit some methods from parent class because I’d have repeated code if I didn’t do it like that. But I’ve stumbled on a problem, caused probably by my limited knowledge of Tkinter and OOP. Here is my code: (it’s really simplified, but it is enough to solve

How to get the value of an Entry created in a def?

I’m working on a project and i would like to get the Value of an Entry created in a def (turned on by a button on Tkinter) So I have my main tkinter menu, with a button which will call the def “panier”. The def “panier” is creating the Entry “value” and another button to call a second def “calcul”.

When enabling a button, disabling the other

Code: Output: When I click any other button, I get: All buttons get enabled. Question: After I’ve clicked one of the buttons which aren’t disabled, I want this one to get disabled. Let’s say I clicked button button2. Thus, button2 will get disabled as shown: The reason why I haven’t found a solution is because the button that will be

Accessing variables from other tab in notebook

Hi all, I was unsuccessful with my last question in this group because my code was too long. I have now brought my code to a minimum and added a screenshot. I hope this time everything is clear and not confusing. My question is: how can I check the variable “val” in Tab1 whether it is smaller than 5. If

How to update a frame with a scrollbar linked in it that has buttons so that it updates and works correctly when adding buttons?

I’m writing an application in tkinter which has the following structure: Notebook Tab (frame on the notebook) Canvas (on the frame) SecondFrame (on the canvas) ← this is where I want to pack my buttons MyButtons (on second frame) While scrollbar is linked as expected to my canvas. Lets say I have 20 buttons when running the program and by

Slide show program, event processing

I need the images to change if the cursor is inside the window without moving, but I managed to make the image changes only if the cursor is moving inside the window, how can I change the code? Answer You can calculate cursor position in loop and show image if it’s located within tkinter window:

tkinter inter-windows drag and drop support

I’m trying to help the owner of tkdnd generate a wheel and distribute it to Pypi so users could simply install the tkdnd extension with a simple pip install TkinterDnD2. I’m after this ‘challange’ for the last two days but could not solve it by myself so far, but I’m sure someone with a deep understanding python packaging and installing

Advertisement