All pastes #579611 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-06-20 19:19 UTC
rendered paste body
pack [Tree .t]
.t insert end root n1  -text "User Defined files" -image [Bitmap::get openfold]

set count 20
foreach i [ exec ls $dir | sort ] {
    .t insert end n1 n[expr [incr count]] -text $i -data $i -image [Bitmap::get file]
}

.t bindText <3> +right_click1

proc right_click1 {args} {
    .t selection set $args
    set argss [.t itemcget [.t selection get] -data]
    tk_popup .popup_view %X %Y
}

expected integer but got "%X"
expected integer but got "%X"
    while executing
"$menu post $x $y"
    (procedure "tk::PostOverPoint" line 31)
    invoked from within
"tk::PostOverPoint $menu $x $y $entry"
    (procedure "tk_popup" line 7)
    invoked from within
"tk_popup .popup_view %X %Y"
    (procedure "right_click1" line 4)
    invoked from within
"right_click1 [Tree::_get_node_name .t current 2]"
    (command bound to event)

Error in startup script: wrong # args: should be "Tree::bindText path event script"
    while executing
"Tree::bindText .t <3> +right_click1 %X %Y"
    ("eval" body line 1)
    invoked from within
"eval [linsert $args 0 Tree::$cmd .t]"
    (procedure ".t" line 1)
    invoked from within
".t bindText <3> +right_click1 %X %Y"
    (file "../c.tk" line 172)


============================================


.t selection set: Cannot select unknown node "387".
.t selection set: Cannot select unknown node "387".
    while executing
"Tree::selection .t set 387"
    ("eval" body line 1)
    invoked from within
"eval [linsert $args 0 Tree::$cmd .t]"
    (procedure ".t" line 1)
    invoked from within
".t selection set $args"
    (procedure "right_click1" line 2)
    invoked from within
"right_click1 387 106 [Tree::_get_node_name .t current 2]"
    (command bound to event)

.t bindText <3> {+right_click1 %X %Y}


proc right_click1 {args X Y} {
    .t selection set $args
    set argss [.t itemcget [.t selection get] -data]
    tk_popup .popup_view $X $Y
}