Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: guidata not updating hObject correctly?
Replies: 4   Last Post: Nov 4, 2013 11:26 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Curious

Posts: 1,923
Registered: 12/6/04
Re: guidata not updating hObject correctly?
Posted: Nov 1, 2013 4:38 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Ken Prager <prager@ieee.org> wrote in message <bbb01$5273ecf4$423cbefe$7048@EVERESTKC.NET>...
> I have a GUI that I created to setup parameters for a simulation. I have
> sets of radio buttons or check boxes, in groups, with callbacks for each
> group. As an example, one looks like this:
>
> function uipanel3_SelectionChangeFcn(hObject, eventdata, handles)
> str=get(hObject, 'Tag');
> switch str
> case 'Err0'
> handles.output.Error_Level=0;
> case 'Err1'
> handles.output.Error_Level=1;
> case 'Err2'
> handles.output.Error_Level=2;
> case 'Err3'
> handles.output.Error_Level=3;
> case 'Err4'
> handles.output.Error_Level=4;
> end
> guidata(hObject, handles);
>
> I return the handles.output structure to my main program, which I then
> decode to set up my parameters. The problem I am having is that the call
> to guidata updates hObject only intermittently. Every time I press a
> button I see that the callback is executed (for example, if I follow in
> the debugger or put some kind of print statement in the callback) but
> updates to handles.output are only returned to my calling script once in
> a while.
>
> Does anyone have any suggestion on what I am doing wrong, or what I can
> do to fix this problem. The problem occurs on 2011b under MacOS, 2012b
> under Windows, and 2012b under Linux.
>
> Thanks in advance,
>
> Ken Prager


Well, I guess the first obvious question is:
How do you KNOW that the result of:
str=get(hObject, 'Tag');
returns one of the cases you are looking for
and not something else like NaN?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.