Matlab GUI: Do I need to pass hObject AND handles? -
Matlab GUI: Do I need to pass hObject AND handles? -
i new writing guis in matlab , noticed when passing info between callbacks 2 values hobject
, handles
passed.
from read , understood, hobject
handle object contains real info (or @ to the lowest degree handles it) , handles
not handle, struct reproducing construction of objects "behind" hobject
. changing (or adding to) handles
not alter real info seen calling function local copy. write changed info object pointed hobject
need phone call guidata(hobject, handles)
.
is right far or did wrong?
i read can create struct similar handles
calling handles = guidata(hobject)
.
so there point in passing both hobject
, handles
1 of own functions instead of passing hobject
, creating handles
locally?
you right far. input parameter handles
handy way of keeping track of components of ui. standard handles
not input parameter. if utilize guide
set parameter follows setting illustration callback
alternative anonymous function @(hobject,eventdata)guitest('pushbutton1_callback',hobject,eventdata,guidata(hobject))
. can of course of study done in code function handles = guidata(hobject)
.
usually not need alter in handles
(only in objects refer to), if need alter in handles
(for illustration if utilize store more handles
ui elements) of import phone call guidata(hobject, handles)
save changes.
so short reply question is: no, can retrieve handles
when need them.
matlab handle matlab-guide
Comments
Post a Comment