diff options
author | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2011-11-14 05:43:13 +0000 |
---|---|---|
committer | Hans-Christoph Steiner <eighthave@users.sourceforge.net> | 2011-11-14 05:43:13 +0000 |
commit | 6d3a518ce3393a2c00b4795d13d7c420ce8b441d (patch) | |
tree | a7786721ba704a144f9f1cc30849977a10da0890 /mkdir.tcl | |
parent | 40359cc18bdb10a89c22f22bd51791f760e094d0 (diff) |
move shared function to a Tcl package, now that tclpd supports a local package
svn path=/trunk/externals/tclfile/; revision=15742
Diffstat (limited to 'mkdir.tcl')
-rw-r--r-- | mkdir.tcl | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -1,24 +1,30 @@ package require Tclpd 0.3.0 package require TclpdLib 0.20 +package require tclfile proc mkdir::constructor {self args} { if {![namespace exists $self]} { namespace eval $self {} } - # set to blank so the var always mkdir - variable ${self}::filename {} variable ${self}::current_canvas [canvas_getcurrent] + # set to blank so the var always exists + variable ${self}::filename {} # add second inlet (first created by default) pd::add_inlet $self list } +# HOT inlet -------------------------------------------------------------------- proc mkdir::0_symbol {self args} { - # HOT inlet variable ${self}::filename [pd::arg 0 symbol] mkdir::0_bang $self } +proc mkdir::0_anything {self args} { + variable ${self}::filename [tclfile::make_symbol $args] + mkdir::0_bang $self +} + proc mkdir::0_bang {self} { variable ${self}::current_canvas variable ${self}::filename @@ -30,9 +36,13 @@ proc mkdir::0_bang {self} { } } -proc+ mkdir::1_symbol {self args} { - # COLD inlet +# COLD inlet ------------------------------------------------------------------- +proc mkdir::1_symbol {self args} { variable ${self}::filename [pd::arg 0 symbol] } +proc mkdir::1_anything {self args} { + variable ${self}::filename [tclfile::make_symbol $args] +} + pd::class mkdir |