Problem using "set(handles, 'Enable', 'off');"

조회 수: 1 (최근 30일)
Jakob Sørensen
Jakob Sørensen 2012년 3월 28일
Hey,
I made a GUI with a bunch of edit texts and sliders, controlling how to show an image. But in order for them not to mess things up, if used before an image is loaded, i made a function to disable them all like this...
function enableAll(mode,handles)
set(handles.sliderXoffset, 'Enable', mode);
set(handles.sliderYoffset, 'Enable', mode);
...
% And so on, on around 20 objects.
I call the function using 'off' to disable it all in the end of the opening function. And then I call it again using 'on', at the end of my load function (which is a menu point).
It disables it just like it's supposed to, but when i re-enable it, the edit texts are back to standard background color (rather than the one i set in Guide) and there is no text in them. This don't even change when i use the sliders which should otherwise set the string in them.
I got a theory, that maybe because the objects are disabled so early in the program, the CreateFcn's don't get to run, and the objects are somewhat incomplete. Could this be the problem? And if it is, then how do I fix it? Any help is appreciated, thanks.
- Jake
  댓글 수: 2
Jan
Jan 2012년 3월 28일
Which OS and Matlab version are you using?
Jakob Sørensen
Jakob Sørensen 2012년 3월 28일
Tested on:
R2010b in Linux (Ubuntu)
R2011b in Windows 7

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Desktop에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by