Re: Gtk2::Entry and signals



On Wednesday, January 28, 2004, at 05:12 AM, Cornel Ghiban wrote:

Hi,

I have an entry in which a user has to input a date like this in this format
DD/MM/YYYY.
When the user starts to type the date (let's say it is 28/01/2004 - today)
he begins with 2 then in the entry we get
2D/MM/YYYY and the non decimal chars are selected
 ^^^^^^^^^
Next he/she presses 8 and we get
28/MM/YYYY
  ^^^^^^^^
and so on..

to avoid the need to block the changed handler, you may actually want to use the "insert-text" signal. whereas "changed" is emitted after the change has happened, "insert-text" is emitted before the change, to give you the opportunity to mangle or otherwise validate the text before insertion.

see Gtk2/examples/insert_text_test.pl , which uses this signal to prevent the user from inserting
"#", turn "-" into "_", and turn "ee" into "whee".
http://cvs.sourceforge.net/viewcvs.py/gtk2-perl/gtk2-perl-xs/Gtk2/ examples/insert-text-test.pl?annotate=1.1.2.1


--
"it's hard to be eventful when you have this much style."
   - me, rationalizing yet another night of sitting at home.




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