[Tkinter-discuss] Bug in pybwidgets/ListBox?
kw at codebykevin.com
Thu Dec 7 18:11:33 CET 2006
-----BEGIN PGP SIGNED MESSAGE-----
I'm trying to use pybwidgets in an application I'm developing; the
BWidgets listbox supports insertion of images alongside text, and is
nicer than the alternatives I've looked at (various tree widgets, for
I've found what I think is a bug. When the BWidgets listbox is placed
inside a panewindow, it does not properly display the
selectforeground/selectbackground colors--in fact, it provides no visual
feedback at all that a listbox item is selected.
The following code illustrates the problem. The listbox does respond to
button events; when an item is selected, text is printed to the text
widget. But there is no visual selection feedback in the listbox itself.
Can someone review this, test it, and let me know if I'm doing something
wrong, or if this is in fact a bug? Thanks.
from bwidget import *
root = Tkinter.Tk()
right = ""
m = Tkinter.PanedWindow(root, orient="horizontal")
textimage = Tkinter.PhotoImage(data="""
left = ListBox(m, selectbackground="black", selectforeground="white")
for text in "abcde":
left.insert("end", text=text*3, image=textimage)
left.bind_image("<Button-1>", (lambda event: printstuff()))
left.bind_text("<Button-1>", (lambda event: printstuff()))
right = Tkinter.Text(m)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the Tkinter-discuss