Bonjour est il possible de faire apparaitre la toolbars (avec zoom in et out ainsi que pan) plus tard dans mon programme.
Pour le moment je n'y arrive que en début , lors de la définition des paramètres de ma fenêtre!
Je souhaiterai donc le faire apparaitre quand je clique sur un pushbutton, j'ai essayé comme cela :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 % fenetre principal Fenetre = figure('Visible','on','toolbar','figure'); h(3) = findall(Fenetre,'tooltipstring','Zoom In'); h(2) = findall(Fenetre,'tooltipstring','Zoom Out'); h(1) = findall(Fenetre,'tooltipstring','Pan'); tb = uitoolbar(Fenetre); copyobj(h,tb); set(Fenetre,'toolbar','none') set(Fenetre,'Units','Normalized','Position',[0 0 1 1],'Color','k'); set(findobj(Fenetre, '-property', 'Units'), 'Units', 'normalized');
définition de la fenetre:
Puis lors de l'appui sur un pushbutton :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 % fenetre principal Fenetre = figure('Visible','on','toolbar','figure'); tb = uitoolbar(Fenetre); copyobj(h,tb); set(Fenetre,'toolbar','none') set(Fenetre,'Units','Normalized','Position',[0 0 1 1],'Color','k'); set(findobj(Fenetre, '-property', 'Units'), 'Units', 'normalized');
Mais j'ai un message d'erreur:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 h(3) = findall(Fenetre,'tooltipstring','Zoom In'); h(2) = findall(Fenetre,'tooltipstring','Zoom Out'); h(1) = findall(Fenetre,'tooltipstring','Pan'); tb = uitoolbar(Fenetre); copyobj(h,tb);
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 ??? Improper assignment with rectangular empty matrix. Error in ==> essai_zoom2>IN at 1277 h(3) = findall(Fenetre,'tooltipstring','Zoom In'); ??? Error while evaluating uicontrol Callback
Partager