MATLAB SIMULINK 7 - GRAPHICAL USER INTERFACE Uživatelská příručka Strana 571

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 759
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 570
1 2 ... 566 567 568 569 570 571 572 573 574 575 576 ... 758 759

Komentáře k této Příručce

Žádné komentáře