Re: Gtk2::TextBuffer 'changed' signal




On Feb 24, 2005, at 6:22 PM, Daniel Kasak wrote:

Hi all.

I've just noticed that I'm not getting signals fired on a Gtk2::TextView's TextBuffer's changed signal.
...
$form->get_widget("MyTextView")->get_buffer->signal_connect ( changed => \&some_sub );
...
some_sub never fires when I edit the text in the textview. It used to, I swear. I've tried with gtk2-perl / glib-perl 1.0.61 and 1.0.42 ( with gtk+ 2.6.2 ).

works for me. Darwin, gtk+ 2.2.4, gtk2-perl HEAD, as well as Linux gtk+ 2.6.2, gtk2-perl 1.072 (last thing i compiled against gnome 2.9). test program below.

Are you sure that the TextBuffer to which you're connecting the signal is the same one that's attached to the TextView when you are editing?


#!/usr/bin/perl -w

use strict;
use Glib ':constants';
use Gtk2 -init;

my $window = Gtk2::Window->new;
$window->signal_connect (destroy => sub {Gtk2->main_quit});
$window->set_default_size (400, 300);

my $textview = Gtk2::TextView->new;
$window->add ($textview);

my $n;
$textview->get_buffer->signal_connect (changed => sub { print "changed! ".(++$n)."\n"});

$window->show_all;
Gtk2->main;


--
"There's a documentary that i wanted to watch on PBS. I heard about it in NPR. ... Oh my god, did i just say that?"
  -- elysse




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]