Skip to content

Instantly share code, notes, and snippets.

@alexperrone
Created January 4, 2016 18:07
Show Gist options
  • Save alexperrone/2970592e19e3479ecba6 to your computer and use it in GitHub Desktop.
Save alexperrone/2970592e19e3479ecba6 to your computer and use it in GitHub Desktop.
window = figure('units', 'normalized', 'OuterPosition', [0 0 .5 .5], ...
'Name', 'My Gui', 'NumberTitle', 'off', 'MenuBar', 'none', ...
'Toolbar', 'none', 'HandleVisibility', 'off');
% Main panel.
mainpanel = uix.Panel('Parent', window, 'Padding', 2, ...
'BorderType', 'none');
tabgroup = uitabgroup('Parent', mainpanel);
% Make the tabs.
tab1 = uitab('Parent', tabgroup, 'Title', 'Tab1');
tab2 = uitab('Parent', tabgroup, 'Title', 'Tab2');
%% Make the first tab.
tab1_main = uix.HBox('Parent', tab1, 'Spacing', 3);
tab1_left = uix.Panel('Parent', tab1_main, 'Padding', 2); % left side
tab1_right = uix.Panel('Parent', tab1_main, 'Padding', 2); % right side
tab1_left_plot_container = uicontainer('Parent', tab1_left); % container needed for plot
tab1_left_axes = axes('Parent', tab1_left_plot_container);
tab1_right_plot_container = uicontainer('Parent', tab1_right);
tab1_right_axes = axes('Parent', tab1_right_plot_container);
% Adjust the layout.
set(tab1_main, 'MinimumWidths', [300 300]);
%% Make the second tab.
tab2_main = uix.HBoxFlex('Parent', tab2, 'Spacing', 3);
tab2_left = uix.Panel('Parent', tab2_main, 'Padding', 2); % left side
tab2_right = uix.Panel('Parent', tab2_main, 'Padding', 2); % right side
tab2_left_plot_container = uicontainer( ...
'Parent', tab2_left); % container needed for plot
tab2_left_axes = axes('Parent', tab2_left_plot_container);
tab2_right_plot_container = uicontainer('Parent', tab2_right);
tab2_right_axes = axes('Parent', tab2_right_plot_container);
% Adjust the layout.
set(tab2_main, 'Widths', [100 -1]);
set(tab2_main, 'MinimumWidths', [300 300]);
@alexperrone
Copy link
Author

The problem

You can adjust the border in the second tab from the first tab. All you have to do is: while on first tab, find with the mouse exactly where the adjustable border on the second tab lies (somewhat tricky to find at first), then you can adjust this border from the first tab like so:

pic2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment