i want to scroll one frame's or canvas 's whole content (it will contain
other subframes and subframes will contain bitmaps) I couldn't find
where is my fault. if you can find my fault or have some example codes
like this please help me thanks from now.....
from Tkinter import *
import Image, ImageTk
root = Tk()
mainFrame = Canvas(root,wid th=400, height=420, bg='gray50',rel ief=RIDGE)
mainFrame.pack( fill=BOTH,expan d=1)
scroll = Scrollbar(mainF rame)
scroll.pack(sid e=RIGHT,expand= 1,fill=BOTH)
mainFrame.confi gure(xscrollcom mand=scroll.set )
subFrame = Frame(mainFrame ,width=200,heig ht=300)
subFrame.pack(e xpand=1,fill=BO TH)
picNo =0
img = []
# two picture placed side by side
imgfile = 'c:\untitled.bm p'
lbl = Label(subFrame, bd=0)
lbl.place(ancho r=NW)
masterImg = Image.open(imgf ile)
masterImg.thumb nail((500, 500))
img.append(Imag eTk.PhotoImage( masterImg))
lbl['image'] = img[picNo]
picNo = picNo + 1
lbl.pack(side=L EFT)
imgfile = 'c:\untitled.bm p'
lbl = Label(subFrame, bd=0)
lbl.place(ancho r=NW)
masterImg = Image.open(imgf ile)
masterImg.thumb nail((500, 500))
img.append(Imag eTk.PhotoImage( masterImg))
lbl['image'] = img[picNo]
picNo = picNo + 1
lbl.pack(side=L EFT)
root.mainloop()
--
Posted via
http://dbforums.com