Bug in pybwidgets, or my code?

K

Kevin Walzer

I'm trying to use pybwidgets in a Tkinter 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
instance).

I've found what I think is a bug. When the BWidgets listbox is placed
inside a panedwindow, 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.

---
import Tkinter
from bwidget import *
import bwidget

root = Tkinter.Tk()
right = ""

m = Tkinter.PanedWindow(root, orient="horizontal")
m.pack(fill="both", expand=1)



left = ListBox(m, selectbackground="black", selectforeground="white")
m.add(left)

for text in "abcde":
left.insert("end", text=text*3)

left.bind_text("<Button-1>", (lambda event: printstuff()))

right = Tkinter.Text(m)
m.add(right)

right=right

def printstuff():
global right
right.insert("end", "pressed\n")

root.mainloop()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,262
Messages
2,571,048
Members
48,769
Latest member
Clifft

Latest Threads

Top