UIContextMenus for toggle buttons
10 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Greetings Matlabers
Is is possible to at uicontext menus to toggle buttons. When I assign a context menu to my button it does not show up when the object is right clicked over. However, I can assign the same context menus to other objects (lines for example) and it shows up. This leads me to think that my problem is not with the context menu but with the toggle button or how it is assigned.
Has anyone experienced/worked with this before?
The toggle button works as expected before the uicontext menu is assigned. It continues to work after with an exception of the context menu I just assigned.
Thanks in advance for any help
dcmenu = uicontextmenu;
dcitem(1) = uimenu(dcmenu, 'Label', 'X', 'Checked', 'on');
dcitem(2) = uimenu(dcmenu, 'Label', 'Y', 'Checked', 'on');
dcitem(3) = uimenu(dcmenu, 'Label', '1/X', 'Checked', 'off');
dcitem(4) = uimenu(dcmenu, 'Label', '1/Y', 'Checked', 'off');
dcitem(5) = uimenu(dcmenu, 'Label', 'X/Y', 'Checked', 'off');
hToolbar = uitoolbar();
hS.legend = uipushtool('Parent', hToolbar, ...
'CData', createCData('legend'),...
'ClickedCallback',@legend_hideFcn,...
'TooltipString', 'Toggle Legend');
0 commentaires
Réponse acceptée
Sean de Wolski
le 8 Août 2012
Modifié(e) : Sean de Wolski
le 8 Août 2012
Nope; the uipushtool ignores the 'UIContextMenu' property.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Interactive Control and Callbacks dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!