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

2 visualizzazioni (ultimi 30 giorni)
Jakob Sørensen
Jakob Sørensen il 28 Mar 2012
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 Commenti
Jan
Jan il 28 Mar 2012
Which OS and Matlab version are you using?
Jakob Sørensen
Jakob Sørensen il 28 Mar 2012
Tested on:
R2010b in Linux (Ubuntu)
R2011b in Windows 7

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Desktop in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by