|
|||
|
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 |
|
|
||||
|
||||
|
|
|
|||
|
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.") |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|