Documentation‎ > ‎Commands‎ > ‎

gnocl::signalStop

This command will stops the execution of the current signal emission for the specified widget.

Synoposis

gnocl::signalStop widget-id signal-type

Options

event
button_press_event
button_release_event
scroll_event
motion_notify_event
delete_event
destroy_event
expose_event
key_press_event
key_release_event
enter_notify_event
leave_notify_event
configure_event
focus_in_event
focus_out_event
map_event
unmap_event
property_notify_event
selection_clear_event
selection_request_event
selection_notify_event
proximity_in_event
focusIn
proximity_out_event
visibility_notify_event
client_event
no_expose_event
window_state_event


NOTE: The above list is experimental and subject to change. Whilst the event names are exactly those used internally by the Gtk+ libraries, these are not consistent with the established Gnocl naming conventions which, for example, would prefer 'buttonPress' rather than 'button_press_event'.

Description


The gnocl::signalStop command effectively forces a break in the execution of the current event loop. The value behind it use is to interrupt the completion of the processes that are consequent upon the normal execution of the signal. Such an example would be the validation or filtering of keyboard entries.

Example

# test_EntryValidate.tcl
#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"
package require Gnocl

set ent1 [gnocl::entry ]

gnocl::window -child $ent1

$ent1 configure -onKeyPress {
    if {[string is alpha %K] } {
        puts %a
    } else {
        gnocl::signalStop %w %e
    }
}






Comments