multiple changed events?



I have a Gtk2::Entry widget:

  $entry = Gtk2::Entry->new;

and I have a callback attached to its changed signal:

  $entry->signal_connect(changed => \&changed_callback, $user_data);


  sub changed_callback
  {
     my ($entry, $user_data) = @_;
     my $text = $entry->get_text;
     warn "cc $text\n";
     ....
  }

When the user edits the text, the callback is called exactly as I
expect. But the user can also edit another widget, which affects this
widget. When the user edits the other widget, I call set_text() on this
widget and am surprised by the result.

The changed callback is called twice from within set_text. The first
time, the text is an empty string. The second time it is the value that
was passed to set_text.

Has anybody else come across this?

Perl module version 1.145
Built for gtk+ 2.6.4
Running with gtk+ 2.6.4

Cheers, Dave



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