Trying to create a window and add a frame with an image into it
import tkinter as tk
from tkinter import ttk
from PIL import Image, ImageTk
class Window(tk.Tk):
def __init__(self,windowTitle,size):
super().__init__()
self.title(windowTitle)
self.geometry(f"{size[0]}x{size[1]}")
self.resizable(width=False, height=True)
#ui attributes
self.frame1 = RadioB(self, 1, "hi", 0, 0)
self.mainloop()
class RadioB(tk.LabelFrame):
def __init__(self, parent, directory, foodName, rowNum, colNum):
super().__init__(parent)
self.config(text=foodName)
imageLoad = Image.open(r'D:\Screenshot-2023-07-12-231818.png')
imageLoad = imageLoad.resize((190,300))
image1 = ImageTk.PhotoImage(imageLoad)
tk.Label(self, image = image1).pack()
self.grid(row = rowNum, column = colNum)
onlyWindow = Window("Login / Sign Up", (760,870))
The layout is fine, just that the images are invisible but takes up space