From b3a15eee3ab2d393dcdbe9a87ad354755a2f9a86 Mon Sep 17 00:00:00 2001 From: "N.N." Date: Fri, 3 Oct 2003 12:08:32 +0000 Subject: *** empty log message *** svn path=/trunk/externals/miXed/; revision=1064 --- test/toxy/default.wid | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'test/toxy/default.wid') diff --git a/test/toxy/default.wid b/test/toxy/default.wid index e9a20a1..abe9a5a 100644 --- a/test/toxy/default.wid +++ b/test/toxy/default.wid @@ -3,6 +3,54 @@ # LATER ask for adding something of the sort to pd.tk: bind Canvas <1> {+focus %W} +proc ::toxy::itemleave {path target varname} { + if {[catch {$path get} ::toxy::itemvalue] == 0} { + set $varname $::toxy::itemvalue +# LATER try sending only if changed + pd $target.rp _value $::toxy::itemvalue \; + } +} + +proc ::toxy::itemvis {tkclass path target name varname cvpath px py} { + set ::toxy::itemfailure [catch {$tkclass $path} ::toxy::itemerrmess] + if {$::toxy::itemfailure} { + pd $target.rp _failure $::toxy::itemerrmess \; + } else { + + if {[info exists ::toxy::itemoptions]} { + catch {eval $path config $::toxy::itemoptions} + unset ::toxy::itemoptions + } + + $cvpath create window $px $py \ + -anchor nw -window $path -tags [concat toxy$name $target] + + if {[info exists ::toxy::masterinits]} { + catch {eval $::toxy::masterinits} + unset ::toxy::masterinits + } + if {[info exists ::toxy::typeinits]} { + catch {eval $::toxy::typeinits} + unset ::toxy::typeinits + } + if {[info exists ::toxy::iteminits]} { + catch {eval $::toxy::iteminits} + unset ::toxy::iteminits + } + + pd $target.rp _config $target.rp [$path cget -bg] \ + [winfo reqwidth $path] [winfo reqheight $path] \ + [catch {$path config -state normal}]\; + +# LATER think where to plug this in + bind $path [concat ::toxy::itemleave $path $target $varname] + if {[info exists $varname]} { + catch {eval $path set $$varname} + unset $varname + } + } +} + proc ::toxy::popup {path target remote entries args} { eval {menu $path.pop} $args set i 1 -- cgit v1.2.1