scrollbar

tkinter: binding mousewheel to scrollbar

tkinter: binding mousewheel to scrollbar Question: I have this scroll-able frame (frame inside canvas actually). import Tkinter as tk class Scrollbarframe(): def __init__(self, parent,xsize,ysize,xcod,ycod): def ScrollAll(event): canvas1.configure(scrollregion=canvas1.bbox(“all”),width=xsize,height=ysize,bg=’white’) self.parent=parent self.frame1=tk.Frame(parent,bg=’white’) self.frame1.place(x=xcod,y=ycod) canvas1=tk.Canvas(self.frame1) self.frame2=tk.Frame(canvas1,bg=’white’,relief=’groove’,bd=1,width=1230,height=430) scrollbar1=tk.Scrollbar(self.frame1,orient=”vertical”,command=canvas1.yview) canvas1.configure(yscrollcommand=scrollbar1.set) scrollbar1.pack(side=”right”,fill=”y”) canvas1.pack(side=”left”) canvas1.create_window((0,0),window=self.frame2,anchor=’nw’) self.frame2.bind(“<Configure>”,ScrollAll) I would like to bind mouse wheel to the scrollbar so that user can scroll down the …

Total answers: 7

Tkinter scrollbar for frame

Tkinter scrollbar for frame Question: My objective is to add a vertical scroll bar to a frame which has several labels in it. The scroll bar should automatically enabled as soon as the labels inside the frame exceed the height of the frame. After searching through, I found this useful post. Based on that post …

Total answers: 8

tkinter: using scrollbars on a canvas

tkinter: using scrollbars on a canvas Question: I’m trying to make a canvas scrollable. However, once I try to set up scrollbars to work with the canvas, tkinter seems to completely ignore the dimensions I initially set for my canvas. I’ve tried packing them all in a frame, setting the canvas to fill the frame …

Total answers: 2

How ro change a Tkinter ScrolledText widget's Scrollbar color?

How ro change a Tkinter ScrolledText widget's Scrollbar color? Question: I’m using the module ScrolledText in a Tkinter GUI. I wish to change the colour of the Scrollbar encompassed in the ScrolledText widget, but I’m having some difficulty. My syntax is correct (according to documentation). Box = ScrolledText(root) Box.vbar.config(troughcolor = ‘red’, bg = ‘blue’) Box.pack() …

Total answers: 3