I have a requirement for a menu that contains a variable number of menuitems, depending on the data being displayed in the form. To me there would seem to be a couple of different ways of doing this:
- When you know how many items you need, reuse any existing ones, use ⎕WC for any new ones, and ⎕EX for any excess ones no longer required. The trouble is, ⎕DQ refuses to work with anything not already defined when ⎕DQ was executed, i.e. this idea won't work.
- So you predefine a maximum number of menuitems, and set them all as ('Visible' 0). This won't work, because you can't set Visible on a menuitem.
This leaves me in a bit of a quandary. I went back to the help page for MenuBar, and I noticed that I can have as many menubars as I like in a form as long as only one is visible at a time. So if I set up a different MenuBar for when this particular menu has 0 menuitems, 1, 2, ..., a lot, I can get my GUI to work the way I want. The problem, as I see it, is that this is messy, and it only needs three or more menus with varying numbers of menuitems to get completely out of hand.
Surely there must be a better way of doing this?