Prev: Converting cell array to numeric
Next: How do i call an m file or mex file from a standalone application
From: Miloš on 24 Mar 2010 16:26 Hello everyone. I'm working on one project and I have this problem: i need to set text for static text object. Lets say its name is text1 and after pushing a button it should say "this is requested text". code: function pushbutton1_Callback(hObject, eventdata, handles) ..... .... .... set(handles.text1,'String','this is requested text') but it prints this error: ??? Reference to a cleared variable handles. Error in ==> projekt_final>pushbutton1_Callback at 102 set(handles.text1,'String','this is requested text') I'm not using text1 anywhere else in project. Strange thing is that I was doing the same thing in my previous project and it worked. I'm really desperate, pls help. Thank in advance, Miloš.
From: Walter Roberson on 24 Mar 2010 16:31 Miloš wrote: > Hello everyone. I'm working on one project and I have this problem: i > need to set text for static text object. Lets say its name is text1 and > after pushing a button it should say "this is requested text". > code: > > function pushbutton1_Callback(hObject, eventdata, handles) > .... > ... > ... > set(handles.text1,'String','this is requested text') > > but it prints this error: ??? Reference to a cleared variable handles. > Error in ==> projekt_final>pushbutton1_Callback at 102 > set(handles.text1,'String','this is requested text') Are you sure you didn't add a 'clear' command somewhere in the Callback ? I've noticed a fair number of people routinely tossing on clear and clear all statements in functions... never been able to figure out why.
From: Miloš on 24 Mar 2010 17:05
Walter Roberson <roberson(a)hushmail.com> wrote in message <hodsqa$2p2$2(a)canopus.cc.umanitoba.ca>... > Miloš wrote: > > Hello everyone. I'm working on one project and I have this problem: i > > need to set text for static text object. Lets say its name is text1 and > > after pushing a button it should say "this is requested text". > > code: > > > > function pushbutton1_Callback(hObject, eventdata, handles) > > .... > > ... > > ... > > set(handles.text1,'String','this is requested text') > > > > but it prints this error: ??? Reference to a cleared variable handles. > > Error in ==> projekt_final>pushbutton1_Callback at 102 > > set(handles.text1,'String','this is requested text') > > Are you sure you didn't add a 'clear' command somewhere in the Callback ? > > I've noticed a fair number of people routinely tossing on clear and clear all > statements in functions... never been able to figure out why. yes that was the problem, thank you very much !!! :) |