PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/tcl/union_parameter_runme.tcl

#
TCL | 36 lines | 26 code | 3 blank | 7 comment | 10 complexity | 795c312f264ee66c25b3721abb6fda99 MD5 | raw file
 1if [ catch { load ./union_parameter[info sharedlibextension] union_parameter} err_msg ] {
 2        puts stderr "Could not load shared object:\n$err_msg"
 3}
 4
 5set event [SDL_Event]
 6
 7for { set i 0 } { $i < 2 } { incr i } {
 8#    puts -nonewline "Loop $i: "
 9    set evAvailable [SDL_PollEvent $event]
10    set evType [$event cget -type]
11#    puts "evType = $evType"
12
13    if { $evType == 1 } {
14        set specEvent [$event cget -active]
15#        puts "specEvent = $specEvent"
16        set type [$specEvent cget -type]
17        if { $type != $evType } {
18            error "Type $type should be $evType"
19        }
20        set gain   [$specEvent cget -gain]
21        set state  [$specEvent cget -state]
22#        puts "gain=$gain state=$state"
23    }
24    if { $evType == 2 } {
25        set specEvent [$event cget -key]
26#        puts "specEvent = $specEvent"
27        set type [$specEvent cget -type]
28        if { $type != $evType } {
29            error "Type $type should be $evType"
30        }
31        set which  [$specEvent cget -which]
32        set state  [$specEvent cget -state]
33#        puts "which=$which state=$state"
34    }
35#    puts ""
36}