Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

deny multiple instances of app?

1 view
Skip to first unread message

Brian Genisio

unread,
Dec 18, 2001, 12:33:00 PM12/18/01
to
I am using wish82 for windows for my tcl/tk script. How do I make it so
only one instance of the script can be running at a time? Currently, I
can run the script, and have lots of windows pop up. I do not want
this, and wish to make it so it just comes up to the already started
app.

Any ideas?

Brian

Michael A. Cleverly

unread,
Dec 18, 2001, 1:00:11 PM12/18/01
to Brian Genisio

http://mini.net/tcl/1558.html demonstrates one possible approach.

Cameron Laird

unread,
Dec 18, 2001, 1:12:44 PM12/18/01
to
In article <3C1F7DCC...@OasisAdvancedEngineering.com>,
.
.
.
It's a subtler question than might first appear. Does
<URL: http://mini.net/tcl/singleton > give you what you
want?
--

Cameron Laird <Cam...@Lairds.com>
Business: http://www.Phaseit.net
Personal: http://starbase.neosoft.com/~claird/home.html

Kevin Kenny

unread,
Dec 18, 2001, 1:00:16 PM12/18/01
to

Use [dde] to check if the app is already running, and send it a message
to pop itself up if it is.

The following script is a basic skeleton:

package require dde

# Establish the DDE topic

set topicName MyTopic

# See if a service with our topic is already running. If so,
# delegate to it.

set otherServices [dde services TclEval $topicName]
if { [llength $otherServices] > 0 } {
dde execute TclEval $topicName {
wm deiconify .
raise .
bell
}
exit
}

# Launch the service

dde servername $topicName
grid [label .l -text [list $topicName is running]]
grid [button .q -text Quit -command exit]


--
73 de ke9tv/2, Kevin KENNY GE Corporate R&D, Niskayuna, New York, USA

Brian Genisio

unread,
Dec 18, 2001, 1:32:27 PM12/18/01
to
Yup :) thhat did it... thanks
Brian
0 new messages