You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I I wanted to make 2 applications in 2 files so that I could run the second one from 1 application. But there is a problem: if a background image is placed in 1 application, then not work in 2. How can this be fixed? Here is an example of the code, the background is placed in the first window, but not work in the second.
import customtkinter as ctk
from PIL import Image
def start():
App2()
class App1:
icon1 = Image.open('res\font33543543.jpg')
font1 = ctk.CTkImage(icon1, size=(600, 400))
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I I wanted to make 2 applications in 2 files so that I could run the second one from 1 application. But there is a problem: if a background image is placed in 1 application, then not work in 2. How can this be fixed? Here is an example of the code, the background is placed in the first window, but not work in the second.
import customtkinter as ctk
from PIL import Image
def start():
App2()
class App1:
icon1 = Image.open('res\font33543543.jpg')
font1 = ctk.CTkImage(icon1, size=(600, 400))
class App2:
icon2 = Image.open('res\font33543543.jpg')
font2 = ctk.CTkImage(icon2, size=(600, 400))
if name == "main":
App1()
When creating the second window, an error occurred:
_tkinter.TclError: image "pyimage2" doesn't exist
Beta Was this translation helpful? Give feedback.
All reactions