MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Guia do Utilizador Página 571

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 759
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 570
Create Menus for a Programmatic GUI
fh = figure('Position',[300 300 400 225]);
cmenu = uicontextmenu('Parent', fh,'Position',[10 215]);
At this point, the figure is visible, but not the menu.
Note “Force Display of the Context Menu” on page 11-86 explains the use of
the
Position property.
Add Menu Items to the Context Menu
Use the uimenu function to add items to the context menu. The items appear
onthemenuintheorderinwhichyouaddthem. Thefollowingcodeadds
three items to the context menu created above.
mh1 = uimenu(cmenu,'Label','Item 1');
mh2 = uimenu(cmenu,'Label','Ite m 2');
mh3 = uimenu(cmenu,'Label','Ite m 3');
If you could see the context menu, it would look like this:
11-83
Vista de página 570
1 2 ... 566 567 568 569 570 571 572 573 574 575 576 ... 758 759

Comentários a estes Manuais

Sem comentários