Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.* 1 > Newsgroup comp.lang.idl-pvwave

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 04-24-2012, 01:32 PM
Rongchang Chen
Guest
 
Posts: n/a
Default runtime application avoid multi open

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
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 04-24-2012, 01:37 PM
David Fanning
Guest
 
Posts: n/a
Default Re: runtime application avoid multi open

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.")
Reply With Quote
  #3 (permalink)  
Old 04-24-2012, 01:38 PM
Vincent Sarago
Guest
 
Posts: n/a
Default Re: runtime application avoid multi open

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


Reply With Quote
  #4 (permalink)  
Old 04-24-2012, 01:44 PM
Vincent Sarago
Guest
 
Posts: n/a
Default Re: runtime application avoid multi open

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

Reply With Quote
  #5 (permalink)  
Old 04-24-2012, 02:09 PM
Rongchang Chen
Guest
 
Posts: n/a
Default Re: runtime application avoid multi open

Thanks David and Vincent.
Reply With Quote
  #6 (permalink)  
Old 04-24-2012, 03:51 PM
Russell
Guest
 
Posts: n/a
Default Re: runtime application avoid multi open

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
Reply With Quote
  #7 (permalink)  
Old 04-24-2012, 05:54 PM
Heinz Stege
Guest
 
Posts: n/a
Default Re: runtime application avoid multi open

And a beautyful way to deal with this is to use a semaphore. IDL
supports them. See SEM_CREATE in the manual.

Heinz
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 07:49 PM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.