Package: gobject

Function gobject:signal-stop-emission

Lambda List

gobject:signal-stop-emission (instance detailed)

Arguments

instance -- a g:object instance whose signal handlers you wish to stop
detailed -- a string of the form "signal-name::detail"

Details

Stops a current emission of the signal. This will prevent the default method from running, if the signal was :run-last and you connected normally, for example, without the :after flag for the g:signal-connect function.

Prints a warning if used on a signal which is not being emitted.

Examples

As an example of the usage, by connecting the following handler to the "insert-text" signal, an application can convert all entry into a widget into uppercase.
;; Handler for the "insert-text" signal
(setf handlerid
      (g:signal-connect entry "insert-text"
          (lambda (editable text length position)
            (g:signal-handler-block editable handlerid)
            (gtk:editable-insert-text editable
                                      (string-upcase text)
                                      (cffi:mem-ref position :intptr))
            (g:signal-stop-emission editable "insert-text")
            (g:signal-handler-unblock editable handlerid))))    
 

See also

2024-6-19