From 5689251b4df7456f43a0d3b357672bbd9fc3a40c Mon Sep 17 00:00:00 2001 From: carmen rocco Date: Tue, 19 Sep 2006 23:21:31 +0000 Subject: *** empty log message *** svn path=/trunk/; revision=5973 --- extensions/gui/ix/toxy/img.wid | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100755 extensions/gui/ix/toxy/img.wid (limited to 'extensions/gui/ix/toxy/img.wid') diff --git a/extensions/gui/ix/toxy/img.wid b/extensions/gui/ix/toxy/img.wid new file mode 100755 index 00000000..34c82dfe --- /dev/null +++ b/extensions/gui/ix/toxy/img.wid @@ -0,0 +1,41 @@ +#console show +package require Img +package require tkdnd +namespace eval ::ix { + variable _ + proc drop_pics {name files x y} { + set c 0 + for {set n 0} {$n < [llength $files]} {incr n} { + if {[regexp {.*/(.+)\.[a-zA-Z0-9]+$} [lindex $files $n] file obj] == 1} { + pd [concat $name obj $x [expr $y + ($c * 32)] widget img [pdtk_enquote [string tolower "img_${obj}"]] #src [pdtk_enquote [regsub -- "^file:" [lindex $files $n] ""]] \;] + incr c + } + } + } + proc pic {c p t src mouseover} { + variable _ + image create photo $t + $p configure -image $t + if {$src ne "none" && [file exists $src]} { + $t configure -file $src + set cb "pd \"$t _cb [lindex [regexp -inline {.*/(.+)\.[a-zA-Z0-9]+$} $src] 1] \;\"" + bind $p "$t configure -gamma 2" + if {$mouseover != 0} { + bind $p +$cb + } + bind $p "$t configure -gamma 1" + bind $p "+$t configure -gamma 0.5; $cb" + bind $p "+$t configure -gamma 1" + } else { + $t configure -format gif -data {R0lGODdhDgAQAKIAAICAgP///8DAwAAAAP8AAP///////////ywAAAAADgAQAAADWQi63Bi6HIIDGLocggMYuhyCAxi6HIIDEUFIEUSBIQMRGEFEhKEyoBoQUUQEykBEYBARBUbIQGAEUQQSRcggYOhyCA5g6HIIDmDocggOYOhyCA6g6LLi6HInADs=} + dnd bindtarget $c.c text/uri-list "::ix::drop_pics $c %D %x %y" + } + set _($t:loc) 0 + } +} +#> img label +#. -borderwidth 0 +#. #src none #mouseover 1 +#. @bang puts "bang" +::ix::pic .^ .- .| {.#src} .#mouseover +puts "pic .- .|" -- cgit v1.2.1