I wish to do a multi threading program such that user can still use the console to control this GUI. Can I ask u how can i write a command to force the GUI to switch image instead of relying on the <button-1> event. thanks to Firat, his code is as the following: import sys import Tkinter as tk from PIL import Image, ImageTk class ImageViewer(object): def __init__(self): self.imagelist = [image1, image2] self.create_widgets() self.ind = 0 def create_widgets(self): self.label = tk.Label(image = self.imagelist[0]) self.label.pack() self.label.bind("<Button-1>", self.change_image) def change_image(self, event): self.ind += 1 self.label.update() try: self.label["image"] = self.imagelist[self.ind] except IndexError: pass root = tk.Tk() image1 = ImageTk.PhotoImage(file = "test1.jpg") image2 = ImageTk.PhotoImage(file = "test2.jpg") w = image1.width() h = image1.height() x = 0 y = 0 root.geometry("%dx%d+%d+%d" % (w, h, x, y)) app = ImageViewer() root.mainloop()
_______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org http://mail.python.org/mailman/listinfo/tkinter-discuss