subclassing from Pmw.ScrolledListBox drops the scroll bar

Joshua Gerth hrakaroo at yahoo.com
Thu Jan 30 17:53:55 EST 2003


Hello,

  I've been searching the archives for a while and the Pmw 'known
bugs' page so I hope this is not an old question.

  I am attempting to subclass the Pmw.ScrolledListBox widget as I want
to make a few changes.  However, when I create an instance of my
subclass it no longer has its scroll bars.  I am using Python 2.2.2
and Pmw 1.1 on Linux.  If anyone has any suggestions or information I
would be most greatful.  At the bottom is my example which
demonstrates this problem.

Thanks,  
   Joshua

------------------------------------
#!/usr/bin/env python

from Tkinter import *
import Pmw

class mylistbox(Pmw.ScrolledListBox):
    def __init__(self,parent=None,**kw):

        self.defineoptions(kw, ())
        Pmw.ScrolledListBox.__init__(self,parent)

root = Pmw.initialise()

items = ('dog','cat','pig','horse','cow','donkey','chicken','goat',
         'dog','cat','pig','horse','cow','donkey','chicken','goat')

Pmw.ScrolledListBox(root, items=items).pack()

mylistbox(root, items=items).pack()

root.mainloop()
------------------------------------




More information about the Python-list mailing list