Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

python - Auto-Completion In wxPython wxComboBox

I've been trying to make a ComboBox which would suggest options as you type, much like an IDE's code suggestions/code-sense, or googles suggestions when you type in a search.

The suggestions would be the items from the ComboBox dropdown, which contained the substring typed in the text box of the ComboBox.

I've tried to make a ComboBox do it, with no luck, I've tried the masked ComboBoxes, and have even tried to subclass the ComboCrtl, but I've always run into troubles either performance wise or not being able to do what I want at all

I have around 2500 items in my list of items (suggestions), and simply clearing the ComboBox and inserting the items which match is way too slow.

How would I go about making such a ComboBox, or is there even a built-in feature i could use?

I can allow a small delay before the suggestions are shown, but the whole window hanging for a second or two is not acceptable, in my oppinion.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Few years ago I made a control like this by subclassing TextCtrl. It supports HTML formating for suggestions. Here you go.

There is also the Combo Box that Suggests Options


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...