Title - the name of this widget in the code. To access an image in the code - to edit it or retrieve from it - it is referenced by
<gui name>.<imageName>. For a GUI named gui, and an image named Image1, this would be gui.Image1.
This title therefore must be unique to the widget.
Photo - the full image location to be displayed in the image. Must be a PNG or JPEG file
Colour - the background colour of the image if not filling the entire widget, as a 6 digit hex code
Relative Location - forces the converted code to reference the image relative to the location of the gui file. Ideal if the python project will end up being distributed, as this referencing method will work on any computer provided the directory structure remains the same.
E.g If the GUI file and the image file (named example.png) are in the same directory, it would be referenced by example.png. If the file was one directory down from the GUI file, in a folder named Images, then it would be referenced by Images\example.png
Maintain Aspect - forces the image to maintain its aspect ratio, and not stretch to fill the widget
Button - determine if the image can be used as a button.
Event name - the name of the event run when the button is clicked. Only applicable for image buttons.
The event called by a button must be located in the parent script. It is a standard python function with one parameter - a string, holding the name of the button that was called. An example is as follows:
def event1(buttonName):
print(buttonName)
This event must be defined below module import statements, but above the run() statement.
IMPORTANT: The Image widget relies on a module named PIL. This should come installed with python. However, if it cannot be found, install it by running the following command in the command prompt: pip install pillow. If unsuccessful, please refer to the FAQ of the troubleshooting guide for more information.
Set widget value - <guiName>.<imageName>.config(<Tkinter field>= <value>)
E.g gui.Image1.config(bg = "#FFFFFF")
Get widget value - <guiName>.<imageName>.cget(<Tkinter field>)
E.g gui.Image1.cget("bg")
Hide image- <guiName>.<imageName>.grid_remove()
E.g gui.Image1.grid_remove()
Show image- <guiName>.<imageName>.grid()
E.g gui.Image1.grid()
Other - Above are the most commonly used methods. However, any of the tkinter label methods and PhotoImage methods are just as valid. Find the full list here and here