Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to create figures and dock them into my main GUI figure?
Date: Fri, 28 Sep 2007 01:08:05 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 27
Message-ID: <fdhk5l$ch8$1@fred.mathworks.com>
References: <favbc6$5uj$1@fred.mathworks.com> <fbqjt8$ea8$1@fred.mathworks.com> <fcn80f$15l$1@fred.mathworks.com> <fcofcq$coa$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-06-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1190941685 12840 172.30.248.36 (28 Sep 2007 01:08:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 28 Sep 2007 01:08:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:430532



> > Docking is different from using subplots. I want to
> > programmatically create a figure (a window) and specify that
> > it should be docked within another figure I have created
> > earlier. Can Matlab do this? Thanks.
> 
> use:
> set(<figurename>, 'WindowStyle', 'docked')


Docking figures places them in the "Figures" group
container. Here is an undocumented/unsupported hack to dock
figures into your own custom-made group. This enables
docking some figures into the "Figures" container and others
into the "myGroup" container:

desktop = com.mathworks.mde.desk.MLDesktop.getInstance;
myGroup = desktop.addGroup('myGroup');
set(get(gcf,'javaframe'), 'GroupName','myGroup');
% docking gcf will now add it to myGroup, not "Figures"

More hacks on groups (resizing, minimizing/maximizing,
docking/undocking etc.) can be found here:
http://tinyurl.com/32q6hb and: http://tinyurl.com/2xpxdp

Yair Altman
http://ymasoftware.com