guile-gtk-general
[Top][All Lists]
Advanced

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

focus_out signal and grab-focus ... how make it work as i'd like to ?


From: David Pirotte
Subject: focus_out signal and grab-focus ... how make it work as i'd like to ?
Date: Thu, 30 Oct 2003 13:21:34 -0500

Hello,

i need to force gtk to stay in a particular entry, if and while
the entry does not valdate a condition, for exemple a valid string
date format

i tried the following, but was unsuccessfull, the system does not
stay on the entry that i wish ot would, the one the user was trying
to get out:


        ;; just for the example
        (define (str-valid-dte? date-str)
          #f)
        
        (gtk-signal-connect entry "focus_out_event"
                            (lambda (a)
                              (let ((date-str (gtk-entry-get-text entry)))
                                (if (str-valid-dte? date-str)
                                    #t
                                    (begin
                                      (system "beep")
==>                                   (gtk-widget-grab-focus entry)
                                      )))))

i also tried 

         (gtk-signal-emit-stop-by-name entry "focus_out_event")

but i don't know what i am doing ... :-))

anyone could help me with this little problem? i am stuck

thanks
david




reply via email to

[Prev in Thread] Current Thread [Next in Thread]