From: "Ofek Shilon" <ofek@REMOVETHISananas-music.com>
Path: news.mathworks.com!newsfeed-00.mathworks.com!webcrossing
Newsgroups: comp.soft-sys.matlab
Subject: Re: GUIs:  GUIDE vs Code Only
Message-ID: <ef3f3e7.11@webcrossing.raydaftYaTP>
Date: Mon, 28 Aug 2006 04:16:13 -0400
References: <ef3f3e7.-1@webcrossing.raydaftYaTP>
Lines: 37
NNTP-Posting-Host: 88.154.137.84
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Xref: news.mathworks.com comp.soft-sys.matlab:366797


Jeremy Smith wrote:
>
>
> What are the pros and cons of creating GUIs (graphical user
> interfaces) with GUIDE and programmatically (code only)?
>

I can relate to pretty much all that has been posted here, and i can
offer my own humble compromise:
i use GUIDE as a visual layout-editor, in a VB-form manner, save it
as a fig file, and extract whatever significant info i've inserted
there to command strings - via fig2cmd:
 <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=11159&objectType=FILE>

This utility takes a fig file and generates a cell array of valid
command strings that can be pasted in code or even sent to eval
(although i've never used it this way except for batch testing). You
can specify object properties to include or exclude, and/or extract
only non-default props. The generated code (still) often needs some
manual polish, but (IMHO) a very minor one, and to me - its
definitely a time saver.

example:
cs = fig2cmd('myfig.fig', 'units','position')

may produce output like -

cs =
'figure('units','characters','position',[112 31.38462 49 25.15385])'
'uicontrol('units','characters','position',[6.2 7.23077 33.8
1.30769])'
'axes('units','characters','position',[5.6 3 36.4 3.84615])'

Any suggestions/bug-reports about the utility are very welcome.

Ofek