hii

I am trying to develop a simple image browser.this is wat i have done so far

from Tkinter import *
top=Tk()

def search():
global pic
global photo

pic=PhotoImage(file='images\\pic.gif')
photo=w.create_image(250,200,image=pic)

w=Canvas(top,height=500,width=500,bg="white")
entry=Entry(top,bg="white")
nxt=Button(top,text="next",activebackground="blue",command=next)
prev=Button(top,text="prev",activebackground="blue")
b=Button(top,text="search",activebackground="blue",command=search)

b.pack()
entry.pack()

nxt.pack(side=RIGHT)
prev.pack(side=LEFT)
w.pack()
top.mainloop()

as u can see it will display a static image,however i want to browse through the images
when i press the next button.Can anybody help.

4
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by Netcode

well think about what you would need to do; you'd need to either have a list of the images or be in a specified directory to browse through the images in that; some useful tools might be:

PIL,Image, ImageTk (ImageTk.PhotoImage)

os

You can just use "command=search" for the next button, and add a get-a-file-name routine to the top of the function.