[Tkinter-discuss] How to Handle Selected Item Event of ListBox
suffii at gmail.com
Thu Mar 3 02:23:59 CET 2011
Gribouillis, helped me to understand how to invoke a function by btn click
event handler, at my last post.Now I am trying to understand how I can
handle an selected item event from a list box?
lets say I have a list box like below and I want to call a method to change
the frame background color based on which item has been selected
from Tkinter import *
def __init__(self, parent):
self.myParent = parent
self.fm = Frame(parent)
self.Lb1 = Listbox(self.fm,height=4, width=15,selectbackground="orange")
root = Tk()
root.title ("Color Option")
root.geometry("%dx%d%+d%+d" % (300, 200, 0, 0))
app = App(root)
can you please take a look at this code and let me know how I can call one
of the method by selecting the item from the list?
View this message in context: http://old.nabble.com/How-to-Handle-Selected-Item-Event-of-ListBox-tp31055478p31055478.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
More information about the Tkinter-discuss