about key event of the Entry



I use an GtkEntry to input numbers.  I try to make it won't accept other
keys except number keys, which means when the user pushes the other
keys, it won't shows up.

I use the signal call back function. What I am doing now is:
1.  set signal call back function (signal: key_release_event)
    if the input key is not a number key, then delete it.

But the thing is that the wrong key still will show up for a very short
time.  I know this is because I use the key_release_event signal.

So I try to put such function in the key_pressed_event.
The thing is : In the "key_pressed_event" call back function, if I
detect the wrong key, how I can prevent it from showing in the entry on
the screen?

If someone knows, please teach me ASAP

Thanks



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