[eunet.micro.acorn] How to create menus in C

walther@econ.vu.nl (Walther Schoonenberg/10000) (01/28/91)

Hello all of you,

I've got a little RISCOS_LIB C problem. I don't know how to make a
nested menu structure in C. If you do, for instance, the following:

  menu temp[5];

  temp[0] = menu_new("Main menu",">Info,Why,Quit");
  temp[1] = menu_new("Why","Can't,I,Do,This?");
  menu_submenu(temp[0],2,temp[1]);
  temp[2] = menu_new("I","Do,This?");
  menu_submenu(temp[1],2,temp[2]);
  temp[3] = menu_new("Do","This?");
  menu_submenu(temp[1],3,temp[3]);

  return temp[0];

In this example I want to create this menu structure:


Main Menu   first level  second level
---------
Info  ->    InfoProg box
Why   ->    Why
Quit        ---
            Can't
            I       ->  I
                        --
                        Do
                        This?
            Do      ->  Do
            This?       --
                        This?


This doesn't work. The temp[[3] submenu disappears completely, without
any warning or error message. Why? Maybe this is not a 'strict hierarchy'
about which the manual talks. But what is a strict hierarchy exactly and
if it is not possible to use menu_submenu to create the above menu
structure, how could you make such a menu structure ?

Any help greatly appreciated.

Greetings,
            Walther

==============================================================================
Walther Schoonenberg
Vakgroep Econometrie
Faculteit der Econonomische Wetenschappen en Econometrie   *       *    * * *
Vrije Universiteit                                         *   *   *   *
De Boelelaan 1105                                          *   *   *    * *  
1081 HV Amsterdam                                          *   *   *        *
The Netherlands                                              *   *     * * *
(020) 5483609                                              walther@econ.vu.nl
==============================================================================