Bug in gtk_edtiable_select_region key_press_event signal



I think I caught a bug when using
 gtk_edtiable_select_region () inside a key_press_event signal callback

Or to explain it better.
1)I have a text widget
2)I want to wrap parenthesis matching when a ')' is typed.
3)I do:
 gtk_signal_connect (GTK_OBJECT (text), "key_press_event", 
                      GTK_SIGNAL_FUNC (text_cb), NULL);
and my cb is:
text_cb (GtkWidget *text, GdkEventKey *event)
{
        if (event->keyval == GDK_parenright)
                gtk_editable_select_region (GTK_EDITABLE (text), 0, 1);

}
 
Ok. So in this example if I first type a '(' and then a ')'
I expect "()" to be selected, right? Ugly things happen instead
I might be doing something stupid
I first hacked with guile-gtk and thought it may be a guile-gtk problem.
So I tryed it with C and the same thing happened.

So, I maybe found a bug or I am doing exactly the same stupid
thing on different languages.

I have wrote a C and guile simplified programs that show the horrible
behaviour.

ariel   

Attachment: prueba.tar.gz
Description: GNU Zip compressed data



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