Thread View: eunet.micro.acorn
2 messages
2 total messages
Started by Walther Schoonenberg/10000
Mon, 28 Jan 1991 09:18
How to create menus in C
Author: Walther Schoonenberg/10000
Date: Mon, 28 Jan 1991 09:18
Date: Mon, 28 Jan 1991 09:18
57 lines
2487 bytes
2487 bytes
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
==============================================================================
Re: How to create menus in C
Author: cabp03
Date: Thu, 31 Jan 1991 12:02
Date: Thu, 31 Jan 1991 12:02
80 lines
3683 bytes
3683 bytes
In article <740@.econ.vu.nl>, walther@econ.vu.nl (Walther Schoonenberg/10000) writes:
>
> 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
> ==============================================================================
--
I seem to remember having a problem like this once. The solution is to attach
the submenus in the correct order i.e. attach temp[2] and temp[3] to temp[1]
then attach temp[1] to temp[0]. In other words, you can't attach a submenu to
a submenu, so you have to attach the submenu to a top level menu menu, then
attach this menu to the higher level menu.
Hope this is clearer.
Colin
==============================================================================
C.J. Whitehead |JANET: C.J.Whitehead@uk.ac.strath.vaxa
Dept. of Physics |Internet:C.J.Whitehead%vaxa.strath.ac.uk@nsfnet-relay.ac.uk
Strathclyde |BITNET: C.J.Whitehead%vaxa.strath.ac.uk@UKACRL
University |UUCP: C.J.Whitehead%vaxa.strath.ac.uk@ukc.uucp
Glasgow G1 1RT |
Scotland. |
===============================================================================
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads