I am writing code using Python and Tkinter. I have two windows in the program: root and install
In both windows I use tabs (notebook and Frame) Everything is fine with the root window - png icons appear, but I have problems with the install window - the tabs themselves are created, but without icons.
The install window is in a function because I call it with a button. Here is the function code
def howinstall():
install = Tk()
install.title('Install guide')
install.iconbitmap('app.ico')
install.resizable(False, False)
install.geometry('500x720')
LinuxIcon = PhotoImage(file='./perfectsystem.png')
WindassIcon = PhotoImage(file='./shitsystem.png')
installnotebook = ttk.Notebook(install)
installnotebook.pack(expand=True, fill='both')
installWindass = ttk.Frame(installnotebook)
installLinux = ttk.Frame(installnotebook)
installWindass.pack(fill='both', expand=True)
installLinux.pack(fill='both', expand=True)
installnotebook.add(installWindass, text='Windows', image=WindassIcon, compound=LEFT)
installnotebook.add(installLinux, text='Linux', image=LinuxIcon, compound=LEFT)
- I tried to define icons at the beginning of the main code (where I define all the images in the code), I tried to define them in the function itself - no result
- There are no problems with files - I wrote test code, with function code, and also used these icons in the root window - everything is fine with them