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

4 次查看(过去 30 天)
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 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by