|
Re: runtime application avoid multi open [message #80029 is a reply to message #80028] |
Tue, 24 April 2012 08:51  |
Russell[1]
Messages: 101 Registered: August 2011
|
Senior Member |
|
|
On Apr 24, 10:09 am, Rongchang Chen <chenrc1...@gmail.com> wrote:
> Thanks David and Vincent.
So this will work fine if you have only one IDL session open. But, if
the user starts two separate IDL windows then the xregister won't know
about the other applications. A clunky way to deal with this, is to
use a "lock file", where you write some file to some directory (say /
tmp/ or something) then everytime you start the application you test
if the file exists. If so, then it's running somewhere. Everytime
you close the program, just remember to delete the file...
Russell
|
|
|
|
Re: runtime application avoid multi open [message #80033 is a reply to message #80032] |
Tue, 24 April 2012 06:44  |
Vincent Sarago
Messages: 34 Registered: September 2011
|
Member |
|
|
On Tuesday, April 24, 2012 3:37:04 PM UTC+2, David Fanning wrote:
> Rongchang Chen writes:
>
>> I have my runtime application, saved it in a .sav. I found it can be
>> multi opened. However, I wish the same application just can be one
>> open/active on the operation system, if someone want to open the same
>> application again, then it will pop-up the already opened one.
>> Does someone know how to realize this?
>
> Use the XRegistered command in your program. If the program
> is already registered, use the Show keyword to Widget_Control
> on your top-level base widget.
>
> Cheers,
>
> David
>
>
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
arghhh David you are every where ;-)
Vincent
|
|
|
Re: runtime application avoid multi open [message #80034 is a reply to message #80033] |
Tue, 24 April 2012 06:38  |
Vincent Sarago
Messages: 34 Registered: September 2011
|
Member |
|
|
Hello,
Is your runtime Application using XREGISTER (i guest it's a Widget) ?
if yes you can just teest if the procedure or function has been already register .
PRO yourAppliMainPro
if (XREGISTERED("yourAppliMainPro") ne 0) then begin
# Do What you want Here
endif
Vincent
On Tuesday, April 24, 2012 3:32:46 PM UTC+2, Rongchang Chen wrote:
> Hi everyone,
> I have my runtime application, saved it in a .sav. I found it can be
> multi opened. However, I wish the same application just can be one
> open/active on the operation system, if someone want to open the same
> application again, then it will pop-up the already opened one.
> Does someone know how to realize this? thanks a lot.
>
> All the best,
> Rongchang
|
|
|
Re: runtime application avoid multi open [message #80035 is a reply to message #80034] |
Tue, 24 April 2012 06:37  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Rongchang Chen writes:
> I have my runtime application, saved it in a .sav. I found it can be
> multi opened. However, I wish the same application just can be one
> open/active on the operation system, if someone want to open the same
> application again, then it will pop-up the already opened one.
> Does someone know how to realize this?
Use the XRegistered command in your program. If the program
is already registered, use the Show keyword to Widget_Control
on your top-level base widget.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|