/* * GUI interface to assist in building the package.variables file for * a new Rexx package. */ -- load the Rexx/DW package Call RxFuncAdd 'DW_LoadFuncs', 'rexxdw', 'DW_LoadFuncs' Call DW_LoadFuncs -- set our global variables to expose !globalv = '!REXXDW. !global.' -- initialise the DW session Call dw_init -- initialise some global values Call GlobalInit -- create main window Call CreateMainWindow -- now we have setup our main window, allow callbacks to fire !global.!allowcallbacks = 1 Call dw_main Exit 0 -- we never get here /* * Initialise global variables */ GlobalInit: Procedure Expose (!globalv) !global.!allowcallbacks = 0 !global.!screenwidth = dw_screen_width() !global.!screenheight = dw_screen_height() !global.!style = dw_or( !REXXDW.!DW_FCF_SYSMENU, !REXXDW.!DW_FCF_TITLEBAR, !REXXDW.!DW_FCF_SHELLPOSITION, !REXXDW.!DW_FCF_TASKLIST, !REXXDW.!DW_FCF_DLGBORDER, !REXXDW.!DW_FCF_SIZEBORDER ) Return /* * Create the initial, desktop window */ CreateMainWindow: Procedure Expose (!globalv) -- create the main window on the desktop !global.!mainwindow = dw_window_new( !REXXDW.!DW_DESKTOP, 'Rexx Package Creator', !global.!style ) -- create and pack a box inside the window topbox = dw_box_new( !REXXDW.!DW_VERT ) Call dw_box_pack_start !global.!mainwindow, topbox, 0, 0, !REXXDW.!DW_EXPAND_HORZ, !REXXDW.!DW_EXPAND_VERT, 0 -- connect the QuitCallback label to the window delete event Call dw_signal_connect !global.!mainwindow, !REXXDW.!DW_DELETE_EVENT, 'QuitCallback' -- Display the main window (and its children) windowx = 500 windowy = 170 Call dw_window_set_pos_size !global.!mainwindow, (!global.!screenwidth % 2) - (windowx % 2), (!global.!screenheight % 2) - (windowy % 2), windowx, windowy Call dw_window_show !global.!mainwindow Return /* * Application quit callback */ QuitCallback: Procedure Expose (!globalv) If !global.!allowcallbacks = 0 Then Return 1 Call dw_window_destroy !global.!mainwindow Exit 0