Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Programmatic GUI pushbutton callback
Date: Thu, 26 Jun 2008 19:02:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 20
Message-ID: <g40p39$m9m$1@fred.mathworks.com>
References: <g40e4n$aiq$1@fred.mathworks.com> <g40jj2$f7m$1@fred.mathworks.com> <g40mb7$i96$1@fred.mathworks.com> <g40nvq$96i$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1214506921 22838 172.30.248.38 (26 Jun 2008 19:02:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 26 Jun 2008 19:02:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 939004
Xref: news.mathworks.com comp.soft-sys.matlab:476094




> 
> As a last question, is there any reason why I should be 
> including the guidata(src,handles) style internal saves in 
> these functions?  I deleted this and the "handles = get
> (whatever) from the first code and it still works it 
> appears.  I understand that when you are using GUIDE this 
> updates the handles structure so if you are carrying 
> variables they actually get changed, but if I'm just 
> setting properties (i.e., visibility on and off) is this 
> useful/necessary? 

No, you only need to load "handles" at the start of
functions that will need to reference it, and save "handles"
at the end of functions that change it. So if a callback
sets properties of objects whose handles are stored in
"handles", you will need to load it to reference them, but
you won't need to save it. I put those in the example
because (if you are using handles at all) it never hurts to
have them there.