ScrolledListBox to select image : ScrolledListBox : Tkinker PYTHON TUTORIALS


PYTHON TUTORIALS » Tkinker » ScrolledListBox »

 

ScrolledListBox to select image


from Tkinter import *
import Pmw

class ImageSelectionFrame ):
   def __init__self, images ):
      Frame.__init__self )
      Pmw.initialise()
      self.packexpand = YES, fill = BOTH )
      self.master.title"Title" )

      self.photos = []

      for item in images:
         self.photos.appendPhotoImagefile = item ) ) 

      self.listBox = Pmw.ScrolledListBoxself, items = images,listbox_height = 3, vscrollmode = "static",
         selectioncommand = self.switchImage )
      self.listBox.packside = LEFT, expand = YES, fill = BOTH,padx = 5, pady = )

      self.display = Labelself, image = self.photos] )
      self.display.packpadx = 5, pady = )

   def switchImageself ):
      chosenPicture = self.listBox.curselection()

      if chosenPicture:
         choice = intchosenPicture] )
         self.display.configimage = self.photoschoice ] )

images = "1.gif""2.gif"]
ImageSelectionimages ).mainloop()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Tkinker
» ScrolledListBox