showMenu


procedure showMenu(title:string; menuType:integer);

Shows a menu on the device display. No other form elements (excepts commands) can be added to the screen when a menu is displayed. 'menuType' can be any of the following:

  var tetris, minesweeper, snake : integer;
      play, clicked : command;	
  begin
    showMenu('Select a game', CH_IMPLICIT);
    
    tetris := menuAppendString('Tetris');
    minesweeper := menuAppendString('Minesweeper');
    snake := menuAppendString('Snake');

    play := createCommand('Play', CM_SCREEN, 1);
    addCommand(play);

    repeat
      delay(100);
      clicked := getClickedCommand;
    until clicked = play;

    showCanvas; // show canvas and remove menu from the screen

    if menuGetSelectedIndex = tetris then playTetris;
    if menuGetSelectedIndex = minesweeper then playMinesweeper;
    if menuGetSelectedIndex = snake then playSnake;
    ...
  end.

See also: User-interface, menuAppendString, menuAppendStringImage, menuIsSelected, menuGetSelectedIndex