diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2011-11-12 05:41:02 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2011-11-12 05:41:02 +0000 |
commit | 63853899de48eec84718fac91487c0f0da439f40 (patch) | |
tree | ecd834c153cb34c60be855e828c1f2330403b345 /exists.tcl | |
parent | ea55962e550e65cf30b372cab7e69f4df54e7035 (diff) |
handle any message as a file name
svn path=/trunk/externals/tclfile/; revision=15730
Diffstat (limited to 'exists.tcl')
-rw-r--r-- | exists.tcl | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -1,6 +1,15 @@ package require Tclpd 0.2.3 package require TclpdLib 0.19 +proc exists::make_symbol {argslist} { + set output [pd::strip_selectors $argslist] + set selector [lindex $output 0] + if {$selector eq "list" || $selector eq "float"} { + set output [lrange $output 1 end] + } + return $output +} + proc exists::constructor {self args} { if {![namespace exists $self]} { namespace eval $self {} @@ -22,6 +31,12 @@ proc exists::0_symbol {self args} { exists::0_bang $self } +proc exists::0_anything {self args} { + # HOT inlet + variable ${self}::filename [make_symbol $args] + exists::0_bang $self +} + proc exists::0_bang {self} { variable ${self}::current_canvas variable ${self}::filename @@ -38,4 +53,9 @@ proc exists::1_symbol {self args} { variable ${self}::filename [pd::arg 0 symbol] } +proc exists::1_anything {self args} { + # COLD inlet + variable ${self}::filename [make_symbol $args] +} + pd::class exists |