[pygtk] Combobox.entry changed handler problem
smcclure at racemi.com
Fri Feb 13 22:18:50 WST 2004
I'm using GTK 1.2 and PyGTK
My combo box glade attributes look like:
I have a handler for the 'changed' signal in a combobox.event widget. I
fill in the combobox.list widget list items dynamically. I have a helper
function that I pass all list items and the one I want selected and it
calls list.clear_items() then list.append_items(itemList). When I do
this, the first item in the list is automatically selected and the
entryWidgetChangedCallback is called. Then I do a
combo.list.select_item(desiredSelection) with the thing passed to my
helper, thus calling the entryWidgetChangedCallback again. Since my
entryWidgetChangedCallback is slow, I want to avoid this.
I tried block and unblock of entryWidgetChangedCallback around the
clear_items() and append_items() and that indeed did the trick. If the
desiredSelection is not the first item in the list everything works
fine. However, I thought a combo.entry.emit('changed') would be in order
if the first item in the list is the selected one since select_item()
doesn't really do anything in that case. That causes
entryWidgetChangedCallback to be called twice.
I also tried:
but that didn't help either.
I'm sure my description is hard to follow, but if it happens to be
comprehensible, any help would be appreciated.
Steve McClure <smcclure at racemi.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20040213/14db8087/attachment.bin
More information about the pygtk