« Return to Thread: GtkField becoming the interactive search field

Re: GtkField becoming the interactive search field

by Scott Mattocks-2 :: Rate this Message:

Reply to Author | View in Thread

CsMAr51 wrote:
>
> When you hit a key on a GtkTreeView (or hit ctrl+f) it opens a field for
> interactive search on the GtkTreeView. I've already used
> GtkTreeView::set_search_column() to do that, but I want to use a
> GtkField that I've created instead of the default one. Here is the
> example of what I want: http://csmar51.dyndns.org/php-gtk/replace.png

I am still not sure where GtkField comes from. I think you mean
GtkEntry. Anyway, I think I know what you are asking.

I don't think there is a method to swap out the search widget with one
of your own. Christian's dev_inspector may help you find a way to pull
it out of the treeview's (grand-)children.

This is how I would do it:
First, turn off interactive search. Then check for changes in your
GtkEntry by connecting to one of the GtkEntry signals (probably
insert-at-cursor) and then search the model (GtkTreeModel::foreach())
from your GtkTreeView. When you find a value you can scroll to the cell
your are looking for (GtkTreeView::scroll_to_cell()).

--
Scott Mattocks
http://www.crisscott.com

--
PHP-GTK General Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

 « Return to Thread: GtkField becoming the interactive search field