set image [svgimage] $image viewportsize 240 320 set sg [scalablegraphics -quality high] set canvas [lcdui.canvas -eventhandler hiddenCanvasEvents] set graphics [$canvas graphics2] $image circle 25 [list 50 0] $sg render $graphics $image # this gives errors like: http://pastebin.ca/812098 proc hiddenCanvasEvents {src ev} { global sg graphics image $image circle 50 [list 50 100] $sg render $graphics $image if {eq [$ev cget -reason] 5} { puts foo } } # this doesnt give errors proc hiddenCanvasEvents {src ev} { global sg graphics image $image circle 50 [list 50 100] $sg render $graphics $image } set cmd_exit [lcdui.command -label Back -longlabel Back -priority 1 -type cancel] proc handleEvents {cmd_exit cmd from} { if {eq $cmd_exit $cmd} { global returnval set returnval 0 tnotify returnval } } $canvas addcommand $cmd_exit $canvas configure -commandaction [list handleEvents $cmd_exit] $canvas setcurrent twait returnval set returnval