« Return to Thread: GtkTreeview and interactive search

Re: GtkTreeview and interactive search for PHP-GTK v2.0

by kksou :: Rate this Message:

Reply to Author | View in Thread

Hi Benjamin,

Just a little suggestion. In your code, you have used:

protected $timeout_handler_delay = 3000;
$this->timeout_handler_id =
Gtk::timeout_add($this->timeout_handler_delay, array($this,
'stop_interactive_search'));

Imagine a user typing slowly. At the end of 3 seconds, the search box will automatically hide, even though he is still typing halfway.

So you might want to change the code slightly so that each mouse or button activity in the search field will reset the start time of inactivity.

Here's a sample code for your reference:
http://www.kksou.com/php-gtk2/articles/setup-interactive-search-in-GtkTreeView-for-PHP-GTK-v2.0---Part-4---automatically-hide-after-3-seconds.php

Regards,
/kksou

 « Return to Thread: GtkTreeview and interactive search