I'm trying to use tkinter canvas with guizero. I've successfully added the canvas to guizero window, but now I need to know how to add guizero widgets to that canvas. My overall goal is to have a scrollable section.
Here's my code
import tkinter as tk
from guizero import *
from PIL import Image
def file_function():
print("File option")
def edit_function():
print("Edit option")
def open_png():
global level_img, picture
path = filedialog.askopenfilename(title='choose video', defaultextension="*.png", filetypes=(('wmw level', '*.png'),('any', '*.*')))
print(path)
if path == '':
return
level_img = Image.open(path)
picture.image = level_img
app = App(title="Hello world", layout='grid')
menubar = MenuBar(app,
toplevel=["File", "Edit"],
options=[
[ ["open png", open_png], ['open with selector', file_function], ["save", file_function], ['export xml', file_function], ['export png', file_function] ],
[ ["Edit option 1", edit_function], ["Edit option 2", edit_function] ]
])
objects = tk.Canvas(highlightthickness=5, highlightbackground='black')
img = tk.PhotoImage(file="image.png")
objects.create_image(0,0, image=img)
text = Text(objects, text='this is a test')
app.add_tk_widget(objects, grid=[0,0], width=200, height=300)
app.display()
I want to be able to control the canvas like a guizero box.