I've hacked into Kiwi entry masks and validation, as contributed by
Ricardo Lenzi (another brazilian, whee). The basic API works more or
less like this:
e = Kiwi.Entry()
e.enable_mask("DD/DD/DDDD")
The entry becomes automatically:
__/__/____
You can insert text at any point and it will fill out correctly. If you
would rather use another character to indicate spaces, any one works:
e.enable_mask("DD/DD/DDDD", empty_char=".")
../../....
e.set_text("16021976") fills out the date accordingly, so the masked
entry becomes:
16/02/1976
e.get_text() returns 16021976
e.get_text(raw=1) returns 16/02/1976
e.insert_text() inserts at the current position, but I'm not sure about
the cursor position yet. Anybody know what would be expected?
Does anybody have any comments on the API, or on the functionality? I'd
like to hear it before I commit and it's left to Bugzilla :-)
Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/