Scrollbar needed to get attached to Canvas

Greg McFarlane gregm at iname.com
Thu Apr 27 08:38:47 EDT 2000


You should not pack widgets into a canvas, you should use
create_window, like this:
    self.sc.create_window(200, 200, anchor='nw', window = button)

But maybe you should be using a Pmw.ScrolledFrame instead of a
Pmw.ScrolledCanvas if all you want to do scroll around a bunch of
widgets.


On 23 Apr, Shah, Navneet wrote:
> I am using Pmw Mega widget. I  already  have canvas with buttons in it.
> How can I attached scrollbar to the canvas. Any help will be
> appreciated.
> 
> Shah
> 
> My code goes as follows:
> 
> class Demo:
>     def __int__(self,parent)
>         #Create the canvas
>         self.sc=Pmw.ScrolledCanvas(parent,
>                      borderframe=1,
>                      labelpos ='n',
>                      usehullsize = 1,
>                      hull_width = 400,
>                      hull_height = 300,
>            )
> 
>           self.sc.pack()
>           button=Tkinter.Button(self.sc.interior(), text='Hello')
>           button.pack(side='left')
> 
> 
> 
> 
> -- 
> http://www.python.org/mailman/listinfo/python-list
> 

-- 
Greg McFarlane     INMS Telstra Australia     gregm at iname.com




More information about the Python-list mailing list