Re: [gtk-list] about key event of the Entry

I have never tried it, but the reference manual for GtkEditable has
this. Looks like the way to do it.

The "insert-text" signal

 void        user_function                  (GtkEditable *editable,
                                             gchar *new_text,
                                             gint new_text_length,
                                             gint *position,
                                             gpointer user_data);

This signal is emitted when text is inserted into the widget by the
user. The default handler for this signal will normally be responsible
for inserting the text, so by connecting to this signal and then
stopping the signal with gtk_signal_emit_stop(), it is possible to
modify the inserted text, or prevent it from being inserted entirely.

        editable : the object which received the signal.
        new_text : the new text to insert.
 new_text_length : the length of the new text.
        position : the position at which to insert the new text. 
		   this is an in-out paramter. After the signal
		   emission is finished, it should point after the newly 			  
inserted text. 
       user_data : user data set when the signal handler was connected.

René Seindal (

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