invalid command name "canvas"
    while executing
"canvas .c -width 444 -height 444"
    (procedure "demo" line 3)
    invoked from within
"demo"
    (in namespace eval "::request" script line 49)
    invoked from within
"namespace eval ::request $script"
    ("::try" body line 12)

OUTPUT BUFFER:

#!/usr/local/bin/wish namespace eval popup { set cursor "" ; # store default widget cursor during rollovers } #---------------------------------------------------------------- # create menu (m) with from list of supplied items (a) #---------------------------------------------------------------- proc InitContextMenu {} { set od /home/moumou/ordali/etc/ package require Img image create photo ZP -file [file join $od loupeplus.xbm] image create photo ZM -file [file join $od loupemoins.xbm] return } proc CreateContextMenu {m} { # destroy any pre-exising menu with the same name destroy $m # create new menus menu $m -tearoff 0 $m add command -compound left -image ZP -label "Zoom +" -command [list puts "Zoom +"] $m add command -compound left -image ZM -label "Zoom -" -command [list puts "Zoom -"] } proc ShowContextMenu {m} { set w [winfo parent $m] lassign [winfo pointerxy $w] x y tk_popup $m $x $y } proc demo {} { canvas .c -width 444 -height 444 pack .c -fill both -expand 1 focus .c InitContextMenu CreatContexteMenu .c.m bind .c [list ShowContextMenu .c.m] } demo