Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: Disabling SAVE button on GUIDE-generated GUIs

Subject: Disabling SAVE button on GUIDE-generated GUIs

From: Paul

Date: 9 Oct, 2007 19:03:48

Message: 1 of 4

I have a question I couldn't readily find the answer to in the
archive. Here's the deal:

I have some GUI applications I have made with GUIDE, and need to have
the toolbar enabled so I can access the nifty pan and zoom and data
tip buttons (the figure property ToolBar is 'auto' for these).

However, this enables a pesky little save button (the disk icon).
Unless I make the GUI .fig file read-only, hitting this little button
will overwrite the .fig file with the current one, causing much
suffering and hellfire later.

So, is there anyway to:

1) disable that individual save button? I can't find any documentation
on this property.

OR:

2) create a toolbar with just the icons I want on it?

Any help is appreciated as always.

thanks,
Paul

Subject: Disabling SAVE button on GUIDE-generated GUIs

From: Yair Altman

Date: 9 Oct, 2007 23:58:22

Message: 2 of 4

 Paul <gtrpaul@gmail.com> wrote in message
<1191956628.072976.241220@r29g2000hsg.googlegroups.com>...
> I have a question I couldn't readily find the answer to in the
> archive. Here's the deal:
>
> I have some GUI applications I have made with GUIDE, and
need to have
> the toolbar enabled so I can access the nifty pan and zoom
and data
> tip buttons (the figure property ToolBar is 'auto' for these).
>
> However, this enables a pesky little save button (the disk
icon).
> Unless I make the GUI .fig file read-only, hitting this
little button
> will overwrite the .fig file with the current one, causing
much
> suffering and hellfire later.
>
> So, is there anyway to:
>
> 1) disable that individual save button? I can't find any
documentation
> on this property.
>
> OR:
>
> 2) create a toolbar with just the icons I want on it?
>
> Any help is appreciated as always.
>
> thanks,
> Paul


Here's how to disable the save button & menu option:
set(findall(gcf,'tag','Standard.SaveFigure'),'enable','off');
set(findall(gcf,'tag','figMenuFileSave'),'enable','off');

You can hide (instead of disable) these elements by setting
the 'visible' property instead of 'enable'.

AFAIK, these are undocumented/unsupported - TMW don't like
people playing around with their default menus/toolbars. It
work great, though.

Yair Altman
http://ymasoftware.com

Subject: Disabling SAVE button on GUIDE-generated GUIs

From: Joerg

Date: 30 Jun, 2008 15:50:20

Message: 3 of 4

> Here's how to disable the save button & menu option:
> set(findall(gcf,'tag','Standard.SaveFigure'),'enable','off');
> set(findall(gcf,'tag','figMenuFileSave'),'enable','off');
>
> You can hide (instead of disable) these elements by setting
> the 'visible' property instead of 'enable'.

Can you give the Tags for the other buttons e.g. Rotate 3D

Subject: Disabling SAVE button on GUIDE-generated GUIs

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 30 Jun, 2008 16:34:42

Message: 4 of 4

In article <g4avbs$e3m$1@fred.mathworks.com>,
Joerg <joerg.dickert@tu-dresden.de> wrote:
>> Here's how to disable the save button & menu option:
>> set(findall(gcf,'tag','Standard.SaveFigure'),'enable','off');
>> set(findall(gcf,'tag','figMenuFileSave'),'enable','off');

>Can you give the Tags for the other buttons e.g. Rotate 3D

>> get(findall(gcf,'-regexp','Tag','.'),'Tag')

ans =

    'figMenuWindow'
    'figMenuDesktop'
    'figMenuTools'
    'figMenuInsert'
    'figMenuView'
    'figMenuEdit'
    'figMenuFile'
    'FigureToolBar'
    'figMenuHelpAbout'
    'figMenuHelpActivation'
    'figMenuHelpUpdates'
    'figMenuWeb'
    'figMenuToolsBFDS'
    'figMenuToolsBFDS'
    'figMenuToolsAlign'
    'figMenuToolsAlign'
    'figMenuViewGrid'
    'figMenuSnapToGrid'
    'figMenuEditPinning'
    'figMenuOptions'
    'figMenuResetView'
    'figMenuDatatip'
    'figMenuRotate3D'
    'figMenuPan'
    'figMenuZoomOut'
    'figMenuZoomIn'
    'figMenuToolsPlotedit'
    'figMenuInsertLight'
    'figMenuInsertAxes'
    'figMenuInsertEllipse'
    'figMenuInsertRectangle'
    'figMenuInsertTextbox'
    'figMenuInsertArrow2'
    'figMenuInsertTextArrow'
    'figMenuInsertArrow'
    'figMenuInsertLine'
    'figMenuInsertColorbar'
    'figMenuInsertLegend'
    'figMenuInsertTitle'
    'figMenuInsertZLabel'
    'figMenuInsertYLabel'
    'figMenuInsertXLabel'
    'figMenuPropertyEditor'
    'figMenuPlotBrowser'
    'figMenuFigurePalette'
    'figMenuPloteditToolbar'
    'figMenuCameraToolbar'
    'figMenuFigureToolbar'
    'figMenuEditClearWorkspace'
    'figMenuEditClearCmdHistory'
    'figMenuEditClearCmdWindow'
    'figMenuEditColormap'
    'figMenuEditGCO'
    'figMenuEditGCA'
    'figMenuEditGCF'
    'figMenuEditSelectAll'
    'figMenuEditDelete'
    'figMenuEditClear'
    'figMenuEditPaste'
    'figMenuEditCopy'
    'figMenuEditCut'
    'figMenuEditRedo'
    'figMenuEditUndo'
    'figMenuFileExitMatlab'
    'figMenuFilePreferences'
    'figMenuFileSaveWorkspaceAs'
    'figMenuFileSaveAs'
    'figMenuFileSave'
    'Plottools.PlottoolsOn'
    'Plottools.PlottoolsOff'
    'Annotation.InsertLegend'
    'Annotation.InsertColorbar'
    'Exploration.DataCursor'
    'Exploration.Rotate'
    'Exploration.Pan'
    'Exploration.ZoomOut'
    'Exploration.ZoomIn'
    'Standard.EditPlot'
    'Standard.PrintFigure'
    'Standard.SaveFigure'
    'Standard.FileOpen'
    'Standard.NewFigure'
    'figMenuWebAccountSub'
    'figMenuWebStore'
    'figMenuWebStudentCenter'
    'figMenuWebStudentFAQ'
    'figMenuWebStudentAccount'
    'figMenuOptionsDataBar'
    'figMenuOptionsDatatip'
    'figMenuOptionsYPan'
    'figMenuOptionsXPan'
    'figMenuOptionsXYPan'
    'figMenuOptionsYZoom'
    'figMenuOptionsXZoom'
    'figMenuOptionsXYZoom'
    'figMenuFileNewVariable'
    'figMenuFileNewModel'


(The -regexp part of the above findall selects only those items that have
a non-empty tag.)
--
  "There is no greater calling than to serve your fellow men.
   There is no greater contribution than to help the weak.
   There is no greater satisfaction than to have done it well."
                                              -- Walter Reuther

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
undocumented Yair Altman 9 Oct, 2007 20:00:26
rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics