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
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 ???). |