Matlab GUI, slider windows are drawn twice

2 views (last 30 days)
David Weller
David Weller on 24 Jan 2019
Commented: Geoff Hayes on 25 Jan 2019
Hi,
I have a really annoying problem with a matlab GUI. I have created three slider windows in it, but two of these windows are drawn two times unfortunately. These slider windows are also functional: I can slide through an image stack without any error, using either a window I placed with guide or the strange copy thing that appears in a quit random position.
What confuses me a lot is, that only two of my three slider winows have such a "twin" ..and yet I haven't found the difference between the two windows that have such a copy and the well working one.
I get a warning, when I open the figure file with GUIDE, but not when I run the GUI from the script.
I already spent a lot of time on this warning, but couldn't solve it.
Here is the warning:
Warning: 'slider' control cannot have a 'Value' outside of 'Min'-'Max' range
Control will not be rendered until all of its parameter values are valid
> In matlab.ui.internal.legacyMoveGUI (line 15)
In movegui (line 125)
In matlab.hg.internal.openfigLegacy (line 102)
In gui_mainfcn>local_openfig (line 286)
In gui_mainfcn (line 158)
In open_sc_gui (line 42)
In guidefunc>layoutActivate (line 1159)
In guidefunc (line 12)
Warning: 'slider' control cannot have a 'Value' outside of 'Min'-'Max' range
Control will not be rendered until all of its parameter values are valid
> In matlab.ui.internal.legacyMoveGUI (line 15)
In movegui (line 125)
In matlab.hg.internal.openfigLegacy (line 102)
In gui_mainfcn>local_openfig (line 286)
In gui_mainfcn (line 158)
In open_sc_gui (line 42)
In guidefunc>layoutActivate (line 1159)
In guidefunc (line 12)
here is the code, referenced in the warning, it's a part ofthe initialization you shouldn't edit (and I am sure, I haven't done anything in this part of the code):
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @open_sc_gui_OpeningFcn, ...
'gui_OutputFcn', @open_sc_gui_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:}); //---->Hey guys, this is line 42!
end
% End initialization code - DO NOT EDIT
This is what the GUI looks like:
And here is the same extract, viewed in GUIDE
Any ideas what the problem is, would be very weclome :)
But please dodn't advice me, to use Appdesigner instead (as some guys at another discussion board already adviced me to do), currently this is no option because I already put a lot of work in the GUI and have no time to start it all over.
  2 Comments
Geoff Hayes
Geoff Hayes on 25 Jan 2019
David - can you attach (to this question) the figure and m file for this GUI?

Sign in to comment.

Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by