Re: How to block alfanumeric entry

Krzysztof Magrel wrote:
> I've GtkEntry in my program. I want sometimes allow to entry alfanumeric
> signs, and sometimes I wanna entry only digits. How could I do it? I know
> how to try what sign is press (event keypressed and event->keyval its the
> sign). I thougth, that event->keyval=0 will enough, but not. I still see
> every signs ;(  . What szhould I do ?

I think the easiest thing to do is validate numerical input after
entry using strtol or g_strtod, and refuse to accept invalid
input (rather than try to stop someone entering letters or
symbols at all).


       David Neary,
    Marseille, France
  E-Mail: bolsh gimp org

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