From: sls Date: Wed, 21 Jun 1995 21:06:26 +0000 (+0000) Subject: Initial revision X-Git-Tag: r_5_1_4~27 X-Git-Url: http://privyetmir.co.uk/gitweb?a=commitdiff_plain;h=d9820c1eb47b83ce1509fb83b8b9342a5df3d35a;p=tkinspect Initial revision --- diff --git a/canvas_list.tcl b/canvas_list.tcl new file mode 100644 index 0000000..a85e2aa --- /dev/null +++ b/canvas_list.tcl @@ -0,0 +1,39 @@ +# +# $Id$ +# +# Handles browsing canvas items. +# + +widget canvas_list { + object_include tkinspect_list + param title "Canvases" + method get_item_name {} { return canvas } + method update_self {target} { + $slot(main) windows_info update $target + $self update $target + } + method update {target} { + $self clear + foreach w [$slot(main) windows_info get_windows] { + if {[$slot(main) windows_info get_class $target $w] == "Canvas"} { + $self append $w + } + } + } + method retrieve {target canvas} { + set items [send $target $canvas find all] + set result "# canvas $canvas has [llength $items] items\n" + foreach item $items { + append result "# item $item is tagged [list [send $target $canvas gettags $item]]\n" + append result "$canvas itemconfigure $item" + foreach spec [send $target [list $canvas itemconfig $item]] { + append result " \\\n\t[lindex $spec 0] [list [lindex $spec 4]]" + } + append result "\n" + } + return $result + } + method send_filter {value} { + return $value + } +}