How to add a menu?

A PocketC native palm library offering native forms and assorted utilities

Postby andyp on Mon Jun 30, 2003 12:41 pm

For the first time I'm trying to add a menu to an app. I've created the rcp file and ran PilRC to create the bin file from it. I've embedded that bin file into my prc file with par. I try to display the menu doing
I checked the app with RsrcEdit and the menu is there, but it still crashes as soon as I start the app.

I also tried to, instead of embedding it in the app, load it with OpenRsrcDb(), but the app still crashes.

Does anybody have any ideas?

Thnx for your help,

Posts: 1
Joined: Wed Jun 25, 2003 5:06 am

Postby jstadolnik on Mon Jun 30, 2003 2:10 pm

The Fctl LOAD command only works on forms. You need to bind a menu to a form to see it.

There are two ways of doing this:

1) Create a resource form with PilRC (or RsrcEdit) and use the MENUID tag to bind a menu to a form (see the FORM tag in the PilRC manual). Note: Many forms can share the same menu.

Then just LOAD and DRAW the form.

2) Create a dynamic form with the Form() function, then use SETMENU Fctl command to bind any menu to that form.

Then just DRAW the form.

Note: You can also use SETMENU on a resource form to change it's menu.


The PToolboxLib guy.
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 4 guests