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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| function essai1
% Création de l'objet Figure
handles(2)=figure('units','pixels',...
'position',[5 35 1270 690],...
'numbertitle','off',...
'name','[GUI] Editeur de scalaires - essai 2',...
'menubar','figure',...
'tag','interface');
handles(2)=uicontrol('style','togglebutton',...
'units','characters',...
'position',[0.2 0.4 37.5 1.5],...
'Callback',{@essai,handles},...
'string','button');
function essai(obj, event, handles)
var_met={'abc' 'def'};
S=3;
it=0;
T=size(var_met);
T=T(2);
% def hpanel ici visible off
hpanel=uipanel(...
'visible','off',...
'units','normalized',...
'position',[0 0.2 0.15 0.5]);
if get(obj,'Value')
set(hpanel,'visible','on');
% rendre hpanel visible on
% def les check box ou list box comme enfants de hpanel
handles(3)=uicontrol(...
'parent',hpanel,...
'style','listbox',...
'visible','on',...
'backgroundcolor',[1 1 1],...
'units','characters',...
'position',[0.2 5 37.5 15],...
'string',char(var_met));
else
% rendre hpanel visible off
set(hpanel,'visible','off');
end |
Partager