[pygtk] gtk.ComboBoxEntry and "changed" event on keystrokes  [SOLVED by rethinking]

Osmo Maatta osmoma at gmail.com
Wed Mar 31 00:18:29 WST 2010


Re-hi,
Case solved.

I had a flaw in my thinking.
The "changed" event now loads the locally cached search-results (in this 
case images).
It is threaded and works very smoothly.
http://www.futuredesktop.com/tmp/out-1.ogv

Kindly
   Moma Antero
http://www.futuredesktop.com


On 03/30/2010 03:09 PM, Osmo Maatta wrote:
> Hello,
>
> I have a small application that has a search-field (gtk.ComboBoxEntry) 
> and a button to start a search job.
>
> The application will start a new search if user:
> 1) Selects an item from the gtk.ComboBoxEntry's drop-down list.
>     This is handled by gtk.ComboBoxEntry's "changed" event. This is Ok.
>
> 2  Types a search query (some text) and presses the [Start search] button.
>     This is handled by the button's "clicked" event. This is Ok.
>
> 3) Presses the [Enter]-key.
>     This is handled by the combo's "activate" event attached to the 
> gtk.Entry. This is Ok.
>
> Because a search-job can take quite a long time, I do not want to 
> activate search for each keystroke, when user types text in the search 
> field.  And this is my problem. Key-strokes activate the "changed" 
> event on the gtk.ComboBoxEntry field. I cannot distinguish between the 
> drop-down list's "changed" event (which I want) and the "changed" 
> event when user types text (I try to avoid this event).
>
> User is welcome to type in some text/query and press the [Start 
> search] button. This is OK.
>
> So how to avoid "changed" event on each keystroke?
>
> A simplified but complete example: http://www.futuredesktop.com/tmp/w4.py
>
> Happy Easter,
>   Moma Antero
>   Grønland
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20100330/f50b6436/attachment.htm 


More information about the pygtk mailing list