Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Adding menu headings/items dynamically

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Adding menu headings/items dynamically
#7005
Posted by: Michael S 2005-09-23 04:43:52
Once I've done this, how do I catch the event if the user selects a newly added dynamic menu item ???
Message2. Re: Adding menu headings/items dynamically
#7006
Posted by: Jeff Glatt 2005-09-23 06:14:34
Manually put an appropriate label in your script.
Message3. Re: Adding menu headings/items dynamically
#7008
Posted by: misi01 2005-09-23 14:51:10
But assume the text for my added menu item is "Check/format". I can't have a REXX label of "Check/Format" since the / character is illegal in a REXX label. What do I do then?
Michael
Message4. Re: Adding menu headings/items dynamically
#7013
Posted by: Jeff Glatt 2005-09-24 00:39:58
Illegal chars (including spaces) get replaced by an underscore when REXX GUI looks for the matching label in your script. In the above, that would be "Check_Format".

Furthermore, you don't have to use the menu text as the REXX label. You could specifically assign your own variable name to a menu item when you add it. The MENU line you pass to GuiAddMenu() allows it.

There's a mistake in the docs. The menu line components should be:

caption, variable, accelerator, options
Message5. Re: Adding menu headings/items dynamically
#7040
Posted by: misi01 2005-09-26 16:30:23
Furthermore, you don't have to use the label. You could specifically assign your own variable name to a menu item when you add it. The MENU line you pass to GuiAddMenu() allows it.
Sorry, didn't understand that. Can you give an example. Ie, what would the variable look like, and what would using a variable result in rather than having a label in the script ?
Michael
Message6. Re: Adding menu headings/items dynamically
#7041
Posted by: Jeff Glatt 2005-09-26 16:36:13
You still have a label, but the label doesn't have to match the menu text:
guiaddmenu("My Menu item, MyMenuVariable", "ITEM", "1 3")
And the label:
mymenuvariable:
   /* Handle the selection of "My Menu item" */
   RETURN


Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-4-26  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0