Clear Filters
Clear Filters

General GUI and program design

5 views (last 30 days)
James
James on 19 Jun 2013
Hi,
I am a new hire at an engineering company and am about to start a fairly large project which I have been allocated 6 months to a year to do and that is building a program. I've built a lot of this program before when I worked previous summers for this company but only wrote script for it. Now, the logic itself will be a bit more complicated or just not as dumb as it use to be and it is expected to be able to be used accross the company (we have the compiler toolbox). To be used accross the company, it will have to have a GUI to work with. I myself have never built a program with a GUI and know very little about it. First, is it a hard thing to learn? Next, does one typically build the GUI form first then get into coding the functions or the other way around? And lastly, any good tips for getting started? Maybe a good online GUI tutorial (sadly blinkdagger is down now as far as I can tell) or just wisdom you have aquired over the years that a new GUI person might appreciaite.
Thanks for your time and help

Accepted Answer

Jan
Jan on 19 Jun 2013
For questions about GUIs, Matt Fig's examples are very useful: FEX: 41 GUI examples.
You can decide if you want to use GUIDE or create the GUI programmatically. I definitely prefer the latter.
You can either start with the GUI or with the computational part. But it is important, to keep both parts strictly separated. The calculations should not use any detail of the GUI, because this would increase the complexity without any benefit and future modifications would be much harder. You can reach this by developing the calculations part at first, which is started with several input arguments. And the GUI creates these inputs and starts the main function of the calculations.
A counter-example, I've found in a code I was ask to maintain:
% ... In the middle of the calculation:
handles = get(GuiH, 'Children');
if get(handles(17), 'Value')
...
Then it was very complicated to figure out, what the 17th handle is only by reading the code. And adding a new object to the GUI demands for massive changes in the part for the calculations. Don't write such junk.
I have problems to formulate clearly, it is after midnight but still very hot in Heidelberg. I hope it can be understood.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!