Based on closer reading in EasyGUI code, it looks like gui.manualgui and gui.container are designed to use the entire shape window as the parent of the GUI, and not for other uicontainer . (Maybe I'm wrong, but I do not see any other files of the gui.container subclass gui.container than autogui and manualgui .
HOWEVER, it seems we are lucky! The gui.container code contains the following in its constructor:
elseif ishandle(uihandle) && strmatch(get(uihandle,'type'), ... {'figure', 'uipanel', 'uicontainer', 'uiflowcontainer', 'uigridcontainer'}) obj.UiHandle = uihandle;
which means that there is a scenario in which the gui.container object can be created as a child of the uipanel . I changed the constructor gui.manualgui to accept the handle graphic and create a new uipanel instead of figure , and then pass it to its superclass constructor:
function obj = manualgui(hg) if exist('hg', 'var') h = uipanel(... 'Parent', hg); else h = figure(... 'Name', 'gui.manualgui', ... 'BackingStore' , 'off', ... 'DockControls' , 'off', ... 'NumberTitle' , 'off', ... 'MenuBar' , 'none', ... 'Resize' , 'on', ... 'Visible' , 'on', ... 'WindowStyle' , 'normal'); end obj@gui.container (h); end
Then I added the code in the gui.container constructor to take into account the fact that some properties of the shapes (namely Color ) are not uipanels (namely BackgroundColor ):
function obj = container(uihandle) if ~exist('uihandle', 'var') obj.UiHandle = figure(); elseif ishandle(uihandle) && strcmp(get(uihandle, 'tag'), 'EasyGUIContainer') % return the existing instance obj = get(uihandle, 'userdata'); return; elseif ishandle(uihandle) && strmatch(get(uihandle,'type'), ... {'figure', 'uipanel', 'uicontainer', 'uiflowcontainer', 'uigridcontainer'}) obj.UiHandle = uihandle; else throw(MException('container:InvalidHandle', 'Invalid HG handle')); end % Backgroundcolor is the same as used by GUIDE if ishandle(uihandle) && strcmp(get(uihandle,'type'), ... 'uipanel') set(obj.UiHandle, 'units', 'pixels', ... 'tag', 'EasyGUIContainer', ... 'backgroundcolor', [0.8314 0.8157 0.7843], ... 'userdata', obj, ... 'DeleteFcn', @(h,e) delete(obj)); else set(obj.UiHandle, 'units', 'pixels', ... 'tag', 'EasyGUIContainer', ... 'color', [0.8314 0.8157 0.7843], ... 'userdata', obj, ... 'DeleteFcn', @(h,e) delete(obj)); end end
I just tried to instantiate the freq1 object in your example; this is because now I am using the gui.manualgui object, not the gui.autogui object. You can expand it to work on autogui ; I'm not right away, since I'm going to quit work where I have MATLAB, and this is a little less nontrivial. Here is the last code that I used to make this figure when I made the following changes:
fh = figure('Units', 'normalized', ... 'OuterPosition', [0.1 0.2 0.4 0.4], ... 'Toolbar', 'none', 'Menu', 'none'); % ------------------Create Tabs--------------------- p = uiextras.TabPanel('Parent', fh); % Tab Component Tab1 = uiextras.HBox('Parent', p); % 1st Tab Tab2 = uiextras.HBox('Parent', p); % 2nd Tab - Horiz Box Tab3 = uiextras.HBox('Parent', p); % 3rd Tab - Horiz Box Tab4 = uiextras.HBox('Parent', p); % 4th Tab - Horiz Box Tab5 = uiextras.HBox('Parent', p); % 5th Tab - Horiz Box Tab6 = uiextras.HBox('Parent', p); % 6th Tab - Horiz Box myGui = gui.manualgui(Tab2); freq1 = gui.slider('Frequency 1 (Hz)', [1 40], myGui); % freq2 = gui.slider('Frequency 2 (Hz)', [1 40]); % phaseDiff = gui.numericmenu('Phase difference (degrees)', 0:30:180); % plotType = gui.textmenu('Lissajous plot type', {'2d-phase', '2d-comet'});
And here is the result:

Obviously, since I'm using manualgui , not autogui , you will either have to manually place the slider yourself, or change autogui to use the correct handle graphic object.