Hello James

'Position',[0.05625,0.0541667,0.7921875,0.8729167]
seems to be normalized values. So don't forget to set units property.

//figure
f=figure(...
    'figure_position', [400,50], ...
    'figure_size', [859,752], ...
    'auto_resize', 'on', ...
    'background', 33, ...
    'figure_name', 'VISA Interface number %d',...
    'dockable', 'off', ...
    'infobar_visible', 'off', ...
    'toolbar_visible', 'off', ...
    'menubar_visible', 'on', ...
    'default_axes', 'on', ...
    'visible', 'off');

handles.dummy = 0;

//tab container
handles.tabframe = uicontrol(f, ...
    'style', 'tab', ...
    'position', [0.05625,0.0541667,0.7921875,0.8729167]);

//set "units" property
handles.tabframe.units = "normalized";

//3rd tab
handles.tab3 = uicontrol(handles.tabframe, ...
    "style", "frame", ...
    "backgroundcolor", [1 0 1], ...
    "string", "magenta")

//2nd tab
handles.tab2 = uicontrol(handles.tabframe, ...
    "style", "frame", ...
    "backgroundcolor", [1 1 0], ...
    "string", "yellow")

//1st tab
handles.tab1 = uicontrol(handles.tabframe, ...
    "style", "frame", ...
    "backgroundcolor", [0 1 1], ...
    "string", "cyan")

//show figure
f.visible = 'on';




Le 26/02/2018 à 16:26, Stéphane Mottelet a écrit :
Le 26/02/2018 à 16:20, James Holland a écrit :
I'm trying to incorporate the 'tab' function in a GUI but I don't see any tab
control when I execute the code. I can't find a tutorial for this either.
can someone please give me an example of how this is done. My code is below:

<code>
f=figure('figure_position',[400,50],'figure_size',[859,752],'auto_resize','on','background',[33],'figure_name','VISA
Interface number %d',...
'dockable','off','infobar_visible','off','toolbar_visible','off','menubar_visible','on','default_axes','on','visible','off');
//////////
handles.dummy = 0;

handles.tabframe = uicontrol
(f,'Style','tab','Position',[0.05625,0.0541667,0.7921875,0.8729167],'Visible','on','String','tab1');
</code>

I also have button controls but they work OK.

TIA James



--
Sent 
from:http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Hello,

there is an example in the tests of gui module :

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
        
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2014 - Scilab Enterprises - Antoine ELIAS
//
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution. The terms
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
function tabs= createTab(uiType)
     f=  figure("dockable",  "off"  ,"infobar_visible",  "off",  "toolbar_visible",  "off",  "menubar_visible",  "off", 
 "default_axes",  "off",  "layout",  "border")
     f.axes_size  =  [470,  410];
tabs= uicontrol(f, "style", uiType, "tag" ,"tab", "constraints", createConstraints("border", "center")); tab1= uicontrol(tabs, "style", "frame", "tag", "tab 1", "string", "tab 1", "layout", "border");
     uicontrol(tab1,  "string",  "button 1");
tab2= uicontrol(tabs, "style", "frame", "tag", "tab 2", "string", "tab 2", "layout", "border");
     uicontrol(tab2,  "string",  "button 2");
tab3= uicontrol(tabs, "style", "frame", "tag", "tab 3", "string", "tab 3", "layout", "border");
     uicontrol(tab3,  "string",  "button 3");
endfunction
//tab
tab=  createTab("tab");

S.
--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet


_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to