[Tkinter-discuss] Text() scrolling, but Canvas() not on OSX

Bob Greschke bob at greschke.com
Fri Jul 4 02:32:29 CEST 2008


My Text() widgets with scrollbars (all Tkinter, not PMW widgets)  
scroll using the two-finger scroll method on my MacBook trackpad, but  
my Canvas()'s with scrollbars don't.  Is there some bind I should be  
doing, or is this just another OSX X11 "feature"?

Typical Text():
     Sub = Frame(LFrm)
     LTxt = Txt["HELP"] = Text(Sub, width = HELPWidth, height =  
HELPHeight, \
             wrap = WORD, font = HELPFont, relief = SUNKEN)
     LTxt.pack(side = LEFT, fill = BOTH, expand = YES)
     Sb = Scrollbar(Sub, orient = VERTICAL, command = LTxt.yview)
     Sb.pack(side = RIGHT, fill = Y)
     LTxt.configure(yscrollcommand = Sb.set)
     Sub.pack(side = TOP, fill = BOTH, expand = YES)

Typical Canvas():
     SSSub = Frame(SSub)
     LCan = Can["PTRD"] = Canvas(SSSub, bg = Clr["B"], bd = 0, width =  
700, \
             height = 500, scrollregion = (0, 0, 700, 500))
     LCan.pack(side = LEFT, fill = BOTH, expand = YES)
     PTRDScroll = Sb = Scrollbar(SSSub, orient = VERTICAL, command =  
LCan.yview)
     Sb.pack(side = RIGHT, fill = Y, expand = NO)
     LCan.configure(yscrollcommand = Sb.set)
     SSSub.pack(side = TOP, fill = BOTH, expand = YES)

Thanks!



More information about the Tkinter-discuss mailing list