Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / GUIADDMENU

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

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. GUIADDMENU
#12576
Posted by: Michael S 2008-12-19 21:25:48 Last edited by: Michael S 2008-12-19 21:31:24 (Total edited 1 time)
Assume I have create a standard, default main window. After the call to GuiCreateWindow('NORMAL') I want to call a second script to add menu items. The idea is that this second script would be used from multiple other main windows as a generalized script. My code in the main script is

LIBRARY rexxgui
guierr = "SYNTAX"
guiheading = 1
guicreatewindow('NORMAL')
rc = generate_db2_source_menu.rex(databases.)

and in the second script, I have

			DO
				databases.0 = databases.0 + 1
				databases.[databases.0] = db.i
				PARSE VAR db.i . '=' next_db':' .
				IF sw_heading = 0 THEN
					DO
						err = guiaddmenu('DB2 Source', 'HEADING', 1)
						sw_heading = 1		/* Set switch */
					END
				err = guiaddmenu(next_db, 'ITEM', 1 menu_item)		
				menu_item = menu_item + 1
			END

The call to the first GUIADDMENU results in "Not a window". Is there a way to circumvent this problem ? (I looked in the online help in case there as some way of "passing" GUIWINDOW, but couldn't see anything).

Okay - I got that to work by passing GUIWINDOW as an argument to the second script (is that the best way to solve it ???).
Message2.
#12579
Posted by: Jeff Glatt 2008-12-20 06:39:20
Right. GuiAddMenu depends upon the GuiWindow variable being set to your desired window handle. So just pass it in, and store it in a variable named GuiWindow.
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Sat 2024-4-20  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0