[Glade-users] How to block some input in GtkEntry field



hello Arthur

the problem with "changed" callback is that the action has already been
done.
look for another event, maybe one that someone would not naturally take for
a textField, for example "key-pressed". i havent tested my self but i think
the solution goes by using an event prior to change the string
best regards

On Wed, Aug 25, 2010 at 4:20 PM, Arthur Shats <ashats at hotmail.com> wrote:

 I am using Glade-2 (very new at it) and C code.

I have a GtkEntry input field on the screen that should take an IP address
(in the format xxx.xxx.xxx.xxx). My goal is to validate the input character
by character and not allow to type anything other than a digit or a ?.?
(dot). I am doing the validation in  _changed callback (correct me if it?s
not the right place). So, when user types an alphabetical character, I don?t
want the cursor to move. Let me know how to do something like this. Once
again, I am using C code generated by Glade-2.



Thanks much,

Art.


_______________________________________________
Glade-users maillist  -  Glade-users at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/glade-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/glade-users/attachments/20100825/84b6f184/attachment.html 




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