[Glade-users] gtkComboBoxEntry question
- From: ashats at hotmail.com (Arthur Shats)
- Subject: [Glade-users] gtkComboBoxEntry question
- Date: Mon, 1 Nov 2010 15:27:01 +0000
I created a gtkComboBoxEntry in Glade and fill in items for the box in Python. To make the list searchable I
use EntryCompletion. All is fine so far. Now I've read that if I use set_inline_completion(True), then any
values matching what I've typed are automatically filled into the EntryCompletion and this allows me to press
the Tab key to confirm the completion.
I tried it, but it didn't work -- even if it finds the exact match, the text is not getting filled into the
EntryCompletion and pressing Tab just jumps to the next field.
Here is my example code:
#here my comboBoxEntry:
state = wtree.get_widget('cmbBoxEntryState')
#create list:
store = gtk.ListStore(str)
store.append(["AK Alaska"])
store.append(["AL Alabama"])
store.append(["NC North Carolina"])
store.append(["ND North Dacota"])
store.append(["NJ New Jersey"])
store.append(["NY New York"])
#set model:
state.set_model(store)
state.set_active(0)
#get the entry child from the comboBoxEntry, set completion and the model:
entry = state.child
completion = gtk.EntryCompletion()
entry.set_completion(completion)
completion.set_inline_completion(True) #this doesn't do what's expected
completion.set_model(store)
completion.set_text_column(0)
So, when I type 'N', I am expecting all the matches that start with 'N' to be displayed in the dropdown and
'NC North Carolina' to be filled into my comboBox. However, I only see the matches that start with 'N'
displayed, but nothing is filled into the box.
Any idea what I missed?
Thanks much.
Arthur.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20101101/5f297fa2/attachment-0001.html
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]