From f1b52f2ea149d2d1dc85d575c8d5900591f012be Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 5 Mar 2003 10:35:13 +0000 Subject: restore old search behavior like we did before gtk+-2 port: - empty log buffer on search startup - freeze buffer while searching - do not realize ourselves the window, it's done by next statement - set initial text to '' so that editable property is disabled once the textview is realized --- perl-install/standalone/logdrake | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'perl-install') diff --git a/perl-install/standalone/logdrake b/perl-install/standalone/logdrake index f1fa4cba9..1506b6f7f 100755 --- a/perl-install/standalone/logdrake +++ b/perl-install/standalone/logdrake @@ -143,7 +143,7 @@ my %files = ( ); my $yy = gtkset_sensitive(gtksignal_connect(new Gtk2::Button(N("search")) , clicked => \&search),0); -my $log_text = new Gtk2::TextView; +my $log_text = gtktext_insert(Gtk2::TextView->new, [ [ '' ] ]); my $log_buf = $log_text->get_buffer(); my $refcount_search; @@ -207,7 +207,6 @@ gtkadd($my_win->{window}, $::isFile && !$::isEmbedded and gtkset_size_request($log_text, 400, 500); -$my_win->{window}->realize; $my_win->{window}->show_all(); search() if $::isFile; $my_win->main; @@ -218,9 +217,8 @@ sub quit { ugtk2->exit(0) } # search functions #------------------------------------------------------------- sub search { -# gtk_text_buffer_delete(); -#BUG $log_text->backward_delete($log_text->get_length()); #BUG -#BUG $log_text->freeze(); + $log_text->window->freeze_updates(); + $log_buf->set_text('', -1); if ($::isFile) { parse_file($::File); } else { @@ -228,7 +226,7 @@ sub search { parse_file($files{$_}{file}) if $toggle{$_}->active; } } -#BUG $log_text->thaw(); + $log_text->window->thaw_updates(); $log_text->show(); gtkflush(); } -- cgit v1.2.1