Re: [patch] GtkSourceView Searching
| From: | Steph Fox | Date: | Mon, 21 Jan 2008 19:12:16 +0000 |
| Subject: | Re: [patch] GtkSourceView Searching | ||
| References: | 1 2 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-4078@lists.php.net to get a copy of this message | ||
Probably isn't too late to sneak it in either ;)
----- Original Message ----- From: "Andrei Zmievski" <andrei@gravitonic.com>
To: "Bob Majdak Jr" <bob@kateos.org>
Cc: "PHP-GTK Developers" <php-gtk-dev@lists.php.net>
Sent: Monday, January 21, 2008 6:59 PM
Subject: Re: [PHP-GTK-DEV] [patch] GtkSourceView Searching
Looks good. Bob Majdak Jr wrote:Probably too late to sneak this in to 2.0.0. This patch fixes/adds to the GtkSourceView currently non-generated functions. It allows for the use of the special search feature allowing case insensitive searching (a built in part of GtkSourceView) I spent a lot of time on this, ended up rewriting some of the defintions. GtkSourceView has a fake type GtkSourceIter, which is /just/ a GtkTextIter, and in fact GtkSourceIter is not even in the GtkSourceView code as a type, just the documentation. However, it does have gtk_source_iter_forward_search() which when bound to a GBoxed of GtkSourceIter breaks *all* GtkTextIter methods. My solution to this was to drop _forward_search() and _backward_search() on the main GtkSourceView class, in addition to some new flags. Screenshot:-- PHP-GTK Development Mailing List (http://gtk.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phphttp://www.opsat.net/temp/sourceview-search.jpgExample Code:http://p.opsat.net/v/172/54 (not the best for example) (it is a copy paste from the project I am working on but eh)Added Methods:array/bool GtkSourceView::forward_search( GtkTreeIter start, string text, int flags[, GtkTreeIter stop] ); array/bool GtkSourceView::backward_search( GtkTreeIter start, string text, int flags[, GtkTreeIter stop] );Both return array(GtkTreeIter, GtkTreeIter), the start/stop of the match when a match is found, and Boolean false when no match was found.Added Flags:GtkSourceView::SEARCH_VISIBLE_ONLY GtkSourceView::SEARCH_TEXT_ONLY GtkSourceView::SEARCH_CASE_INSENSITIVE