[pygtk] which widget

Stephen George steve_geo at optusnet.com.au
Fri Dec 3 05:21:52 WST 2010


On 2/12/2010 6:16 PM, Leon Bogaert wrote:
> Yeah, but how should I for it to always be on the entries in the ListStore? Because now one can type anything in the combobxEntry. A user could type something, ignore the suggestions and move the focus to another widget. How should I deal with this situations? For example, an on_update handler which checks if the entry in the comboBoxEntry exists in the liststore. If it doesn't exist: remove the entry. But that doesn't seem really user friendly.

Have a look at http://www.astro.umass.edu/~dpopowich/python/   for the 
thing called ValidatedEntry.

While it is not a solution to your problem, it does have hooks in place 
to prevent the user from leaving the entry until the data entered is 
valid, .. I believe it's this functionality that you are looking for 
your combo box, to stop the user leaving the combo box till they have 
selected a valid entry from your liststore.

There is a demo inside the download, but usage of the demo is not so 
intuitive, you need to do through the code to understand what your are 
meant to do.

It might give you enough ideas to cobble up something useful.

Also I notice this http://www.gtkforums.com/about4619.html which may be 
more applicable to what your asking.

Steve


More information about the pygtk mailing list