Gtk::entry - signal_change



hi

i am testing the 'signal_change' signal on the Gtk::Entry, i belive it lives on Gtk::Editable. I am using the win32 port of gtkmm 2.8 and gtk+ 2.8.
When i set the text twice programattically, the change signal is emitted 3 times.

I am assuming the 3 events are the text being set, the text being 'cleared' and the text being set again.
Is this assumtion correct?


here is a code sample, the method is called 3 times.

void textChange(){
  cout << "text change" << endl;
}

int main(int argc, char *argv[]){
  Gtk::Main kit(&argc, &argv);

  Gtk::Entry entry;
  entry.signal_changed().connect(sigc::ptr_fun(textChange));

  entry.set_text("Foo");
  entry.set_text("Bar");

  return 0;
}

here is the output:

text change
text change"
text change



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