When constructing complex menus, the ability to continue a menu in a new winio@ call by following %mn (or %pm) with more than one [ is really helpful. It allows the programme to break the menu construction up into small parts. For example,
iw=winio@('%mn[Actions,[Continue,Stop]]','CONTINUE','STOP')
can be written as
iw=winio@('%mn[Actions,[Continue]]&','CONTINUE')
iw=winio@('%mn[[Stop]]','STOP')
However, it would be helpful to be able to break this down further to something like:
iw=winio@('%mn[Actions]&') ! NB callback intentionally left blank
iw=winio@('%mn[[Continue]]&','CONTINUE')
iw=winio@('%mn[[Stop]]','STOP')
The intention here is that the first line does not have a callback function because it only acts as a higher level menu item for Continue and Stop. But such an option is unavailable for two reasons: (1) line 1 is invalid because a callback function is required, and (2) even if something like 'CONTINUE' is supplied, line two creates an error message. As potential (but unsuccessful) solutions, the following creates a second Actions menu item:
iw=winio@('%mn[Actions]&','CONTINUE')
iw=winio@('%mn[Actions[Continue]]&','CONTINUE')
iw=winio@('%mn[[Stop]]','STOP')
while the following creates a formatting error message at line 1:
iw=winio@('%mn[Actions[]]&','CONTINUE')
iw=winio@('%mn[[Continue]]&','CONTINUE')
iw=winio@('%mn[[Stop]]','STOP')
Could %mn take some kind of modifier to indicate that it should not have a callback function to make the following valid?
iw=winio@('%mn[Actions]&')
iw=winio@('%mn[[Continue]]&','CONTINUE')
iw=winio@('%mn[[Stop]]','STOP')
But perhaps there is a way to do this that I am missing?
The reason such an option would be valuable may be illustrated by the following example:
iw=winio@('%mn[~Actions[Continue]]&',igrey,'CONTINUE')
iw=winio@('%mn[[Stop]]','STOP')
Although this is a simple example, in a complex menu this first call can become fairly complicated. The complexity is not so much with the possibly long formatting code (by which I mean the first argument to winio@), but rather with the possibly intricate ordering of all the additional arguments that may be required before the actual callback function. (Although, with reference to another post I have on array arguments to %ga, if all these additional arguments could be supplied as an array rather than as individual scalars the complexity would be reduced somewhat.) In effect, I am looking for a way of constructing a complex menu without having to make the first line of code point all the way to the first callback.