All Questions
742 questions
-1
votes
0
answers
16
views
How do i get an entry from tkinter from within a seperate function? [duplicate]
I need to get the entry for 'searchEntry' when the onClick function is ran after the button is clicked. I know I could use a global but I've read its a work around, not a solution, any ideas?
def ...
0
votes
2
answers
68
views
I can't seem to get a function in one class to properly call a function in another class in tkinter - Python
I am having trouble getting this text box to print text when the button from Class3 is pressed. If I call the same function from Class2 then everything is fine. But from Class 3 not so much. I can ...
0
votes
0
answers
47
views
Only one tkinter notebook frame creates. (using class)
I trying to use class to create multiple tkinter notebook tabs. But I can only make one tab at once.
from tkinter import *
from tkinter import ttk
class Tabs:
current_tab = Frame(notebook)
...
0
votes
2
answers
90
views
What is the best way to access object of subclass in other subclass?
Attached is a minimum working example of a problem I have:
class A():
def __init__(self, *args, **kwargs):
self.b=B(self)
self.c=C(self)
class B():
...
0
votes
2
answers
43
views
access a component in a tkinter frame class from another frame class
I created a 2 Frames application in tkinter inspired by https://www.geeksforgeeks.org/how-to-change-the-tkinter-label-text/. The purpose is to import a new image by clicking on the start button, and I ...
-3
votes
1
answer
43
views
a member not recognized in a method [closed]
this is a class for designing a toplevel window with Tkinter
the issue comes from the method which tries to get an info from the member self.lbox but it is not recognized as a member. the error is :
...
1
vote
1
answer
54
views
Access different widgets and functions in tkinter from different classes
I have an application that transforms coordinates from one system to another. The source and the target frames use many similar functions like the ones executed when a combobox change.
How to create ...
-2
votes
1
answer
62
views
The same Tkinter window pops up again after the next button is pressed
Whenever I run the program the window will popup and I will enter the info into it like normal, when I press the next button the window exits like it's supposed to but then the same window pops up ...
2
votes
1
answer
81
views
Python Tkinter with OOP. How to define function for changing button attributes?
I am learning Object Oriented Programming for Python using Tkinter.
I want to create a Class for each type of widgets (right now considering only Buttons).
I am passing the Button class to my main App ...
0
votes
1
answer
63
views
how to inherit from tkinter
I see two methods for using the tkinter module with python classes.
the first method uses the super() method.
the second method does not.
So the example code looks like this:
import tkinter as tk
...
0
votes
3
answers
65
views
Python tkinter Class Object - How to change button text when button is defined in one Class, and its command function is defined outside
I have defined Class GUI which creates a button with a YES text on it.
I do not understand how I should pass the command to it when the function is defined outside of the Class.
import tkinter as tk
...
0
votes
1
answer
84
views
Python tkinter notebook as a method in a class
This is a problem with creating a tkinter notebook in a method in a class.
This question is solved by removing master, which is not my problem: Python Tkinter - How add a notebook class into a tk....
0
votes
0
answers
46
views
Trouble initiating a DateEntry widget in tkcalendar inside of another class
I want to write a class that creates a paired checkbox and a corresponding DateEntry widget any number of times a new instance is created.
All the instances are children to one single window, this ...
1
vote
1
answer
57
views
Python tkinter cloase first window while opening second window [closed]
I'm trying to close the first window as the second window opens. Both windows close, or the first window closes and the second window never opens.
This question has a similar problem but was solved ...
0
votes
1
answer
75
views
Python tkinter class multiple windows
Using tkinter, I'm trying to open one window from another window and doing so by creating the windows in a class.
This question talks about tkinter and class, but not multiple windows: Python Tkinter ...
0
votes
1
answer
49
views
How to call a function from another frame in tkinter witheout getting an AttributeError: object has no attribute
Hello everyone I am kinda new to python and Tkinter I start it few month ago.
I'm currently working on tkinter app for my work. this is a simple app that got 3 pages one for the home page, another is ...
0
votes
1
answer
85
views
Why height parameter is not working in tb.Label Widget?
I am using tb.Lable from ttkbootstarp but i am not able use height, bd attribute
The error ->
File "C:\Program Files\Python311\Lib\tkinter\__init__.py", line 1692, in _configure
self....
0
votes
1
answer
46
views
I am creating a personal finance tracker and I need a sort feature for that But I am getting confused with that
I need to implement a sort functionality where clicking on a column heading in the treeview table sorts the data based on that column. The sorting should toggle between ascending and descending order.
...
0
votes
0
answers
30
views
Module / Class Call in a list?
I'm trying to put someting like tk.CTkEntry(master=self, placeholder_text="Amount") in a list (or anything alse). I think I tried every "list like" option.
Any Ideas how to do that ...
0
votes
0
answers
46
views
Python tkinter How to make a button that calls a function in a class
I'm doing a simple calculator in python and I'm wondering if it is possible to make a button that calls a function in a class.
from tkinter import*
l1 = []
l2 = []
root = Tk()
class przycisk:
...
0
votes
1
answer
56
views
Tkinter App - My Toplevel window is not appearing. App is stuck in mainloop
I'm trying to build a work schedule tracker, starting with the header. A picture attachement shows how the design will look once completed
I have three classes so far,
InputWindow: A Toplevel window ...
0
votes
0
answers
89
views
Error "'str' object is not callable" when using simpledialog.askstring()
My code:
class Punkty_Edycja_Frame(ttk.Frame):
def __init__(self, parent):
super().__init__(parent)
self.grid(row = 1, column = 0, sticky='nesw')
self.rowconfigure((0, 1, ...
1
vote
0
answers
48
views
Switching between two frames on seperate files in tkinter
I am writing a program where I have the opportunity, to switch between two frames which are one two separate Files. The main file is called "Main_Menu" while the other file is called "...
0
votes
1
answer
53
views
add method to existing class from external library
I want to create a custom function working on the class Wm from the library Tkinter. the custom function is the following:
def centerw(width, height):
screen_width = tk.Wm.winfo_screenwidth()
...
0
votes
0
answers
42
views
How do I activate a widget using Tkinter inside of a match operation of another class?
So basically I have this program that will parse the contents of a file and ask for input from the user when it comes across a command. It was a console-only program, and I'm trying to convert it into ...
0
votes
1
answer
43
views
Python Tkinter - Passing controllers as arguments of a tkinter frame
I've got a main class called App that invokes 4 controllers. The method start_from_home_page() creates an object of type HomePage and I want this object to have access to all 4 controllers which I ...
0
votes
1
answer
96
views
Accessing object defined in Tkinter App from Frame
As it stands I have a code that defines a tkinter app (myGUI), and within that app various pages are defined as tk.Frames. I want the top section of each Frame to have the same base layout, so I ...
0
votes
1
answer
50
views
Tkinter using classes unable to change button state
I'm trying to create a Tkinter app using classes but I'm running into an issue being able to change the button state to disabled after clicking the button.
The error I'm currently getting is:
...
1
vote
1
answer
90
views
why do I need to specify a variable name for a Canvas Image Object to apper in Tkinter
I created a custom canvas image object class of tkinter. But when I make a instance of it it does not appear in the canvas.
Here is a simple class to create a Image Object
import tkinter as tk
from ...
0
votes
1
answer
82
views
no idea where tkinter label is being defined in class
I found this code for a label class for a tkinter popup I was making. I didn't understand how the label appeared, but I just went on with it. However later I found that I needed to refer to the ...
0
votes
1
answer
45
views
Python Tkinter how to get the coordinates of an object which is in a different class
So I am making a python tkinter game.
I have the following classes
class GameObject(object)
class Ball(GameObject)
class Paddle(GameObject)
class Brick(GameObject)
class Game(tk.Frame)
In the class ...
0
votes
0
answers
51
views
How do I fix this high school python+mysql project?
This project is an Inventory Management system. I am still a beginner My code has a lot of issues, which I know. Right now I am struggling with using two different classes together. (I also think I ...
0
votes
0
answers
133
views
I created a Rock Paper Scissors (with tkinter) in object format but I can't display it
Python tells me that I have an error in my canvas, even though I don't see any Here is the error message:
PS C:\Users\name\OneDrive\Bureau\python\création_python\jeu_pfc> & "C:/Program ...
-1
votes
1
answer
60
views
I can't put the Tk widgets on the windows
I am extending the tk widgets to make a gui app. The problem is that I can put them on the main window without an error, but they are not visible. I have called the super constructor, but it still not ...
0
votes
1
answer
81
views
How to create a Frame/Canvas using class in Python and use it many times with different widgets inside it?
I am new in Python. I am developing a program which actually is a small shell for phpMyAdmin. In my program I need in some Windows (which is created by TKinter) draw a scrolled canvas. I've written a ...
0
votes
1
answer
91
views
The Tkinter Listbox is not displaying as expected
Encountered with one problem. Making "modification" of default tk Listbox, adding Scrollbar widget to it. I made class, added Scrollbar, and tried to test it. I didn't saw Listbox, only ...
-2
votes
2
answers
146
views
Python: Problem with positional arguments required, when i import a textbox of a class from an external file into a function from another file
I have problems when i try to import a textbox from another file's class. In the x.py file, i would like to import the textbox of the Page1 class of the page1.py file. The error occurs when you ...
-2
votes
1
answer
116
views
Why can't I move the images?
For some reason the images just wont move when I click on them even though the same program worked on my laptop.
I want to be able to click on an image and then click to a blank square and move the ...
0
votes
0
answers
56
views
Python Tkinter App to Check Status for a List of Domains
I got 2 issues that need solving please:
"check domain manually" doesn't work as expected. When all domains in the file are checked, I press the button again it doesn't clear old results ...
1
vote
2
answers
67
views
Python Tkinter: Sending realtime data to another class/window
This is just a small sample of a project's larger problem. There are 2 classes. Both are Tkinter windows. SecondClass sends information to the FirstClass's Tkinter label. The expected behavior is to ...
0
votes
1
answer
42
views
Why the widgets I have inside the GenerateQR class doesn't show up?
I'm converting my code to OOP, and I fixed all the errors so far from this code snippet, but I couldn't figure out why widgets in the GenerateQR class doesn't show up, even tho the class is called and ...
0
votes
1
answer
85
views
TKinter creating buttons and labels from functions
I'm working on a small hobby project to build a dice rolling app, currently using tkinter. I've got this large block of code to create the buttons and labels needed for each die, but it looks a mess ...
0
votes
0
answers
73
views
Tkinter frame not appearing when using .place() but does when using .pack(), even with the same coordinates
I created a scrollable frame with buttons that are place using the .pack() method. It worked well but now I want to change it to .place() in order to have more control on the button placement.
Problem:...
0
votes
0
answers
87
views
Can a python class contain a method to delete itslef?
I am coding a tkinter class for data manipulation. I would like to find a way to delete the object by clicking on a button, exactly like the X button to quit a window.
Here is what my interface looks ...
-1
votes
1
answer
146
views
Call a parent method after all the child __init__ are done like a "finally __init__" method
I want to call a method from my parent class at the end of child class init. To do that i know i can just call a super().parent_method() at the end of each child class.
The probleme is that i'm ...
0
votes
1
answer
1k
views
Why am I getting this error? AttributeError: type object 'App' has no attribute 'tk'
This code returns the error: "AttributeError: type object 'App' has no attribute 'tk'" when ran.
import tkinter as tk
from tkinter import ttk
def entryField(parent):
frame = ttk.Frame(...
0
votes
1
answer
101
views
Passing Parameters onto objects using self
I am trying to use multiple buttons that all call the same function but have different parameters of 1, 2, 3, and so on. I want to have these parameters pass through the function in the class and only ...
0
votes
0
answers
46
views
Interrupt a program process running from class A to class B of another class
import os
import sys
import time
import tkinter as tk
class Time:
def __init__(self):
self.Time_sleep()
self.Num_calc()
def Time_sleep(self):
time.sleep(100) # ...
0
votes
2
answers
61
views
I can't access variables from one class in another one - Python
I'm learning OOP and am making a calculator. I have classes for the main program (the parent program), buttons, and entries.
Main program:
class Program(tk.Tk):
def __init__(self, title, size):
...
0
votes
1
answer
107
views
Tkinter MVC Frame Switching
I am working on a MVC Program to learn about classes in python using tkinter however I am stuck on an error I keep getting that makes zero sense and is driving me crazy. I keep getting the error ...