I have created the default ubuntu-application template using quickly and I'm trying to work out how to change the displayed image through code.
The default image shows an ubuntu logo with the path ".../media/background.png" within glade.
If I open the projects window python file (testWindow.py as the projects name is test) and add the following lines at the base of the finish_initializing function (changing nothing else within the default files created),
self.PNG = self.builder.get_object("image1") self.PNG.set_from_file("../media/background.png")
The program runs but instead of the ubuntu logo, the small missing file icon displays. However no error message displays in the terminal and changing the png file to another png, or moving it to the same directory as the python file (changing the second lines file to "background.png") gives the same issue. I can use the clear() function to remove the image successfully but I'm clearly doing something wrong and I can't seem to make any headway into the documentation for the image widget.
In case it helps to know what I'm aiming to do, I'm trying to create a simple flashcard program, displaying a Japanese character and requiring the user to input the correct pronunciation and displaying another image of a new character if the user is successful.
Thank you for any help you can give!