I built a GUI in 2013b with Tabs and uipanels on each tab. When I upgraded to Matlab 2015b the uipanels on all tabs except for the first are invisible.
*Why are the uipanels now invisible in 2015 and how to I fix that?
In my code I created a 'Parent' uipanel and button for each tab. See code below.
I show a simple example with a uipanel on tab1 and a uipanel and uicontrol on tab2.
The uipanel is not visible on tab2 and if I change the uicontrol to have a parent of tab2 the uicontrol is now visible. I reproduced this same error using the new uitabgroup as well.
%%Creating a User Interface with Tab Panels
% This example shows how to create a user interface with tab panels in MATLAB(R).
% Copyright 2014 The MathWorks, Inc.
%%Objects Used to Create Tab Panels
% The tabgroup and tab objects are used to build user interfaces with tab
% panels. A tabgroup object is created using the |uitabgroup| function. A
% tab object is created using the |uitab| function with a tabgroup as its
f = figure(... 'Units', 'pixels',... 'Toolbar', 'none',... 'Position',[ 240, 135, 1440, 810],... 'NumberTitle', 'off',... 'Name', 'VDA GUI',... 'MenuBar', 'none',... 'Resize', 'off',... 'DockControls', 'off',... 'Color', [1 1 1]); tgroup = uitabgroup('Parent', f);tab1 = uitab('Parent', tgroup, 'Title', 'TAB1');tab2 = uitab('Parent', tgroup, 'Title', 'TAB2');tab3 = uitab('Parent', tgroup, 'Title', 'TAB3');%%Tab1 uipanel
PT1 = uipanel('Parent',tab1,... 'Units','normalized',... 'Position',[0.1 0.3 0.5 0.5],... 'Title','Document Headings',... 'FontWeight', 'bold',... 'FontSize', 12,... 'FontUnits','normalized',... 'ForegroundColor',[0 0 0],... 'BackgroundColor',[.95 .95 .95],... 'HandleVisibility','callback'); %%Tab2 uipanel
PT2 = uipanel('Parent',tab2,... 'Units','normalized',... 'Position',[0.035 0.75 0.3 0.175],... 'Title','Compressor Manufacturer',... 'FontWeight', 'bold',... 'FontSize', 12,... 'FontUnits','normalized',... 'ForegroundColor',[0 0 0],... 'BackgroundColor',[.95 .95 .95],... 'HandleVisibility','callback'); ET2 = uicontrol('Parent',PT2,... 'Style','edit',... 'Units','normalized',... 'Position',[0.1 0.75 0.8 0.2],... 'FontWeight', 'bold',... 'FontSize', 10,... 'FontUnits','normalized',... 'ForegroundColor',[0 0 0],... 'String','TEST1',... 'Backgroundcolor',[1 1 1],... 'Enable','on',... 'HandleVisibility','callback'); ET = uicontrol('Parent',tab2,... 'Style','edit',... 'Units','normalized',... 'Position',[0.1 0.75 0.8 0.2],... 'FontWeight', 'bold',... 'FontSize', 10,... 'FontUnits','normalized',... 'ForegroundColor',[0 0 0],... 'String','TEST2',... 'Backgroundcolor',[1 1 1],... 'Enable','on',... 'HandleVisibility','callback');
Best Answer