Why am I receiving error when using uifigure?
Show older comments
I am trying to run a program which uses the uifigure command to create a GUI. My code was running fine yesterday. Today, when I try running the code, I get the following error message:
Error using uilistbox (line 42)
Functionality not supported with figures created with the figure function. For more information, see
Graphics Support in App Designer.
Error in slicingObjectsV01 (line 44)
h.listBox = uilistbox(h.loadPanel);
I cannot figure out how to fix this. I am using the uifigure command so I do not understand why MATLAB thinks that I am using the figure command.
Here is the beginning of my code:
%% GUI
h.slicingObjects = uifigure;
h.slicingObjects.Color = [0.8 0.8 1];
h.slicingObjects.Position = [45 70 1410 900];
h.slicingObjects.Units = 'Pixels';
h.slicingObjects.Resize = 'Off';
h.slicingObjects.Visible = 'off';
h.slicingObjects.Name = 'Slicing Objects';
%% Image Display Plot
h.sliceDisplayBackground = uiaxes(h.slicingObjects,'Units','Pixels');
h.sliceDisplayBackground.XTick = [];
h.sliceDisplayBackground.YTick = [];
h.sliceDisplayBackground.Color = [0 0 0];
h.sliceDisplayBackground.Position = [10 10 880 880];
h.sliceDisplay = uiaxes(h.slicingObjects,'units','pixels');
h.sliceDisplay.XTick = [];
h.sliceDisplay.YTick = [];
h.sliceDisplay.Color = 'black';
h.sliceDisplay.Position = [10 10 880 880];
%% Load Panel
h.loadPanel = uipanel('units','pixels');
h.loadPanel.Title = 'Load';
h.loadPanel.TitlePosition = 'centertop';
h.loadPanel.BackgroundColor = 'white';
h.loadPanel.FontName = 'Century Gothic';
h.loadPanel.FontSize = 20;
h.loadPanel.FontWeight = 'bold';
h.loadPanel.Position = [900 640 500 250];
listBoxItems = {'Series 1','Series 2','Series 3','Series 4'};
% List Box
h.listBox = uilistbox(h.loadPanel);
h.listBox.Items = listBoxItems;
h.listBox.BackgroundColor = 'white';
h.listBox.FontName = 'Century Gothic';
h.listBox.FontSize = 15;
h.listBox.Enable = 'off';
h.listBox.Position = [20 90 460 120];
Accepted Answer
More Answers (0)
Categories
Find more on Environment and Settings 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!