/* GUIBEGIN WINDOW , 0, 0, 400, 200, POPUP|CAPTION|SYSMENU|MINBOX|MAXBOX|THICK, , Picture Viewer FONT 8, 400, MS Shell Dlg MENU DEND MENU HEADING File ITEM Load picture..., PICTURE < DEND GUIEND */ LIBRARY rexxgui GuiErr = "SYNTAX" GuiHeading = 1 /* FUNCDEF some OS functions we need for handling a PAINT event */ FUNCDEF("BeginPaint", "32u, void, void stor", "user32") FUNCDEF("EndPaint", "32, void, void", "user32") GuiCreateWindow('NORMAL') Again: DO FOREVER GuiGetMsg() CATCH SYNTAX CONDITION('M') SIGNAL Again CATCH HALT FINALLY GuiDestroyWindow() /* Free any PicObject we got */ DROP PicObject END RETURN /* Called when the "Load picture..." menu item is selected. */ PICTURE: /* Get the picture filename */ FN = '' err = GuiFile('FN', , 'This is the title') IF err = '' THEN DO /* Free any PicObject we previously got */ DROP PicObject /* Load the new PicObject */ GuiPicture("PicObject", FN) /* Redraw the window */ GuiRefresh(, 1) END RETURN /* Called when the window needs to be redrawn. */ WM_PAINT: /* Erase the background and get a device context */ hdc = BeginPaint(GuiWindow, ps) DO /* Draw the picture object at an XY position of (0, 0) */ IF EXISTS("PicObject") THEN GuiPicture("PicObject", hdc, 0, 0) FINALLY /* End paint */ EndPaint(GuiWindow, ps) END /* Don't let Rexx Gui process this event. */ RETURN ""