FAQ
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()


--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedDec 8, '06 at 9:16p
activeDec 8, '06 at 9:16p
posts1
users1
websitepython.org

1 user in discussion

Kevin Walzer: 1 post

People

Translate

site design / logo © 2022 Grokbase