diff options
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 |