Mar-21-2021, 02:05 PM
(This post was last modified: Mar-21-2021, 02:29 PM by deanhystad.)
Looks like you tried a bunch of different things and now the code is littered with the leftovers of unsuccessful attempts. For example, this adds an attribute to a LabelFrame. It doesn't do anything, but now you have a frame with an attribute named imgtk.
When you run your code do you see that mode is being toggled each time you press the button? Does it toggle between printing "Camera is enabled" and "camera is disabled"?
What is the value of ret? Is the problem that the read is failing?
camera_frame.imgtk = imgtkI also don't see how this is not causing an error.
camera_frame.configure(image = imgtk)image is not an attribute of LabelFrame. You cannot display an image in a LabelFrame. You can display an image in a Label. The Label in a LabelFrame is text only. Maybe you never get to where this code is executed.
When you run your code do you see that mode is being toggled each time you press the button? Does it toggle between printing "Camera is enabled" and "camera is disabled"?
What is the value of ret? Is the problem that the read is failing?