-- code generated by Win32Lib IDE v0.21.1 Build Sept-29-2006 constant TheProgramType="exw" include Win32Lib.ew without warning include graphex.ew -------------------------------------------------------------------------------- -- Window Window1 constant Window1 = createEx( Window, "Reisizing Gfx Example", 0, Default, Default, 400, 300, 0, 0 ) --------------------------------------------------------- -------------------------------------------------------------------------------- with trace integer thegfx sequence oldsize oldsize = {0, 0, 0, 0} thegfx = newGfx(Window1, 0, 0, 0, 0) -- let sizing routine handle it setTimer(Window1, 1000, 100) -- update 100ms setTimer(Window1, 1001, 50) -- IMPORTANT! setGfxAutoPaint(w32False) procedure draw_gfx(integer gfxid) gfxClear(gfxid, Black) for i = 0 to gfxWidth(gfxid) by 30 do for j = 0 to gfxHeight(gfxid) by 30 do VOID = gfx_draw(gfxid, GP_ELLIPSE_SOLID, gfxColour(rand(12) +2), {i, j, i+10, j+10}) end for end for end procedure procedure resize_gfx(integer gfxid) sequence size size = getClientRect(Window1) if size[3] != oldsize[3] or size[4] != oldsize[4] then gfxResize(gfxid, size[3], size[4]) oldsize = size draw_gfx(gfxid) end if end procedure procedure SizerTimer (integer self, integer event, sequence params)--params is ( int timerId) integer id id = params[1] if id = 1000 then resize_gfx(thegfx) elsif id = 1001 then draw_gfx(thegfx) doGfxPaint(Window1) end if end procedure setHandler( Window1, w32HTimer, routine_id("SizerTimer")) WinMain( Window1,Normal ) --this program has 65 lines without including this line. If there is a discrepancy please send this file zipped to Judith.