Completion with a GtkEntry



Hello,

I Am trying to code some kind of completion with a GtkEntry.
The goal is to select completed text after someone typed letters in a GtkEntry.
To do that, I connected the signal changed of the Entry and in the callback I
use that to complete, then highlight added text :

  gtk_signal_handler_block(GTK_OBJECT(entry), handler_changed);
  gtk_entry_append_text(GTK_ENTRY(entry), txt);
  gtk_signal_handler_unblock(GTK_OBJECT(entry), handler_changed);

  gtk_entry_select_region(GTK_ENTRY(entry), 0,
                        GTK_ENTRY(entry)->text_length);

Everything works well (text is correctly inserted) but text is not selected
at all. I tried to use gtk_signal_conncet_after instead of gtk_signal_connect
but that doesn't change anything.

Any suggestion would be greatly appreciated.





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