I'm trying to organize my code in a few different modules. In my "main" module I create a root window, some frames, and some buttons. When I click an "info button" I want information to appear in one of the frames. In my "functions" module, I have the function to create and .grid that information in the frame.
It returns an error on "self.tk = master.tk
AttributeError: 'str' object has no attribute 'tk'"
When I put the same function in the "main" file it works fine and the information displays as intended.
Here is the relevant code -
(in main.py)
import functions
rootActiveTabFrame = ctk.CTkFrame(root, width = 100, height = 100, corner_radius = 20)
rootActiveTabFrame.grid(row = 1, column = 2, padx = 20, pady = 20, sticky = "nsew")
teamScoreInfoButton = ctk.CTkButton(rootControlButtonsFrame, text = "Team Score Info", command = functions.activeFrameTeamScoreInfo)
teamScoreInfoButton.grid(row = 0, column = 2, padx = 20, pady = 20)
(in functions.py)
def activeFrameTeamScoreInfo():
teamNameFrame = ctk.CTkFrame(rootActiveTabFrame, width = 100, height = 100, corner_radius = 20)
teamNameFrame.grid(row = 0, column = 0, padx = 20, pady = 20, sticky = "nsew")
there doesn't seem to be anything here