Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Gui multiple instances
Date: Wed, 4 Nov 2009 19:24:03 +0000 (UTC)
Organization: Univ of Huddersfield
Lines: 17
Message-ID: <hcskcj$ao9$1@fred.mathworks.com>
References: <hcq5l4$hek$1@fred.mathworks.com> <hcq938$meu$1@fred.mathworks.com> <hcsfh0$7ag$1@fred.mathworks.com> <hcshts$7b8$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1257362643 11017 172.30.248.35 (4 Nov 2009 19:24:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 4 Nov 2009 19:24:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 672361
Xref: news.mathworks.com comp.soft-sys.matlab:582497


Thankyou,

I used the following code at the beginning of my GUI function

% Check to see if an instance of GUI is already running -----------------
set(0,'showhiddenhandles','on');
p = findobj(gcf,'tag','uis');
set(0,'showhiddenhandles','off');
if ~isempty(p)
    figure(p);
    msgbox('Simulate Data is already open.');
    return;
end

Which seems to work fine in 2008a, but causes a new figure to be opened on the first run in 7.0.1.

Is this the type of code you meant?  And can I prevent a new window opening in 7.0.1?