comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: runtime application avoid multi open
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: runtime application avoid multi open [message #80028] Tue, 24 April 2012 10:54
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
And a beautyful way to deal with this is to use a semaphore. IDL
supports them. See SEM_CREATE in the manual.

Heinz
Re: runtime application avoid multi open [message #80029 is a reply to message #80028] Tue, 24 April 2012 08:51 Go to previous message
Russell[1] is currently offline  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 #80032 is a reply to message #80029] Tue, 24 April 2012 07:09 Go to previous message
Rongchang Chen is currently offline  Rongchang Chen
Messages: 12
Registered: August 2008
Junior Member
Thanks David and Vincent.
Re: runtime application avoid multi open [message #80033 is a reply to message #80032] Tue, 24 April 2012 06:44 Go to previous message
Vincent Sarago is currently offline  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 Go to previous message
Vincent Sarago is currently offline  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 Go to previous message
David Fanning is currently offline  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.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: runtime application avoid multi open
Next Topic: small consulting firm in NM needs an IDL developer

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:46:41 PDT 2025

Total time taken to generate the page: 0.00602 seconds