Bonjour,

Je cherche à tester un slider dans mon GUI sous Siclab, tout marche bien si j'opère directement depuis une fenêtre simple, mais si j'essaie de refaire la même chose en rajoutant un uimenu intermédiaire :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
f=figure();
...
hexpl = uimenu(f,'label', '1er menu');
hext = uimenu(hexpl, 'label', 'Choix 1', 'callback', 'choix_ext');
...
function choix_ext()
///////////////////ESSAI SLIDER
uicontrol(f,"Style","text","string", "Année","Position",[260,100,220,20],"Callback","","horizontalalignment","center","background",[1,0.5,0.1]);
hchoixext = uicontrol(f,"style","slider","Min",1991,"Max",2006,"value",2006,"SliderStep", [1,5],"position",[280 70 180 20],"units", "pixels","callback","def_ext","tag","ext");
    TxtMinext=uicontrol(f, 'style', 'text', 'position', [250 70 30 20], 'string', '1991');//affichage de la valeur min-max
    TxtMaxext=uicontrol(f, 'style', 'text', 'position', [465 70 30 20], 'string', '2006');//affichage valeur curseur
    Valext=string(get(hchoixext, "value"));
endfunction//choix_ext
 
function def_ext()
    //////////////////////////////////////////
    set(findobj("tag", "ext") , "value", 2006);//???
    //////////////////////////////////////////
    Valext=string(get(hchoixext, "value"));//???
    TxtValext=uicontrol(f, 'style', 'text', 'position', [360 50 30 20], 'string', '2006');
    set(TxtValext, 'string', Valext);
    //    set(TxtValext, 'string', num2str(2006));
endfunction//def_ext
l'affichage se passe bien mais en voulant jouer avec les flèches du slider j'obtiens l'erreur:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
!--error 4 
Variable non définie: hchoixext
 
at line       5 of function def_ext called by :  
if exists("gcbo") then %oldgcbo = gcbo; end;gcbo = getcallbackobject(61);def_ext;if exists("%oldgcbo") then gcbo = %oldgcbo; else clear gcbo; end;
while executing a callback
Je suppose que c'est une histoire de handle mais je ne vois pas comment corriger...


merci d'avance !