“Convention over configuration” is sometimes a very good idea. Especially as it saves you lots of configuration and testing for special cases.
There is a few important aspects of naming conventions for the toolbox that matter:
Every GUI consists of one main figure, and this figure should have a unique tag that should start with the name of the main GUI window, followed by an underscore:
hMainFigure = figure('Tag','trEPRgui_infowindow',... ... );
At the same time, this tag should be identical with the function name.1) In this case, the above example would simplify to:
hMainFigure = figure('Tag',mfilename,... ... );
There are several advantages of this approach:
findobj()
function)mfilename
for getting the figure tag.Every GUI function should start with the name of the main GUI of the toolbox, followed by an underscore, e.g.:
trEPRgui_infowindow()
Subwindows currently follow a slightly different scheme. Suppose you have a help window for the infowindow, then its name would be:
trEPRgui_info_helpwindow
Please note: Whereas the main GUI function, here trEPRgui_infowindow()
, resides inside the GUI
directory of the toolbox (for details see the directory layout of the toolbox), the respective help window (and every other subwindow of this GUI) should reside inside the private
directory within the GUI
directory.