I just found this snippet in the Tcl/Tk docs (http://tcl.tk/man/tcl8.4/TkCmd/send.htm ) and it shows how to check if another instance of an app is running.
This script fragment can be used to make an application that only runs once on a particular display.
if {[tk appname FoobarApp] ne "FoobarApp"} { send -async FoobarApp RemoteStart $argv exit } # The command that will be called remotely, which raises # the application main window and opens the requested files proc RemoteStart args { raise . foreach filename $args { OpenFile $filename } }
I think given the new Tcl code I am writing, it could be an easy solution to the problem of only launching one instance. Basically, if Pd is started via pd.tk first, then it would only allow one instance. If it was started with 'pd', which launches pd.tk, then it would allow multiple instances.
This that is feasible?
.hc
----------------------------------------------------------------------------
kill your television
This is a great idea. Generally, when launching pd from the GUI you are relinquishing fine control and the "natural default" is to use the same Pd process for everyone.
cheers Miller
On Mon, Jan 12, 2009 at 11:38:05PM -0500, Hans-Christoph Steiner wrote:
I just found this snippet in the Tcl/Tk docs (http://tcl.tk/man/tcl8.4/TkCmd/send.htm ) and it shows how to check if another instance of an app is running.
This script fragment can be used to make an application that only runs once on a particular display.
if {[tk appname FoobarApp] ne "FoobarApp"} { send -async FoobarApp RemoteStart $argv exit } # The command that will be called remotely, which raises # the application main window and opens the requested files proc RemoteStart args { raise . foreach filename $args { OpenFile $filename } }
I think given the new Tcl code I am writing, it could be an easy solution to the problem of only launching one instance. Basically, if Pd is started via pd.tk first, then it would only allow one instance. If it was started with 'pd', which launches pd.tk, then it would allow multiple instances.
This that is feasible?
.hc
kill your television
Pd-dev mailing list Pd-dev@iem.at http://lists.puredata.info/listinfo/pd-dev