Re: Out of breath - second try
- Posted by cafromsw at yahoo.com
Feb 19, 2003
I didn't run this code but this typo jumped out at me
while reading it. Forgive the wrap but Yahoo mail is
kind of lame. Kind of a 'get what you pay for'
situation.
> procedure Window1_onClose (integer self, integer
> event, sequence params)
> killTimer ( Window1, PolyTime )
> end procedure
> setHandler(Window1, w32HClose,
> routine_id("PushButton4_onClose"))
surely the routine_id should be "Window1_onClose"
Chris Arthur
--- r.stowasser at web.de wrote:
>
> Hello list,
>
> it seems that the code I attached was not sent
> completely due of the
> dashes between the procedures. So I would like to
> try it again:
>
> The following little program works quite nice, but
> somehow I am loosing
> my gdi and system resources in Win95 and Win98
> (probably in Win Me too)
> when running it. I am using Euphoria v 2.3 and
> win32lib 57.9 with some
> changes I found in the mailing list.
> Using Window´s resource monitor (Rsrcmtr.exe) I can
> see visually how my
> little pc gets out of breath after starting the
> show. Am I doing
> something wrong? After exiting the program the
> resources are (almost)
> released again. I suppose I need some more statement
> anywhere in the code?
>
> Kind regards
>
> Roland Stowasser
>
>
> include Win32lib.ew
> without warning
>
> integer ticks ticks = 0
>
> constant Window1 = createEx( Window, "Art Gallery",
> 0, Default, Default,
> 400, 300, 0, 0 )
> constant PolyTime = 2000
> constant PushButton2 = createEx( PushButton, "Exit",
> Window1, 8, 12, 88,
> 28, 0, 0 )
> constant PushButton4 = createEx( PushButton,
> "Start", Window1, 8, 48,
> 88, 28, 0, 0 )
> constant PushButton6 = createEx( PushButton, "Stop",
> Window1, 8, 84, 88,
> 28, 0, 0 )
>
>
> procedure Polygon()
> integer z
> sequence size, points
> integer height, width
>
> z = rand(20)+12
>
> size = getClientRect(Window1)
> height = size[4]-size[2]
> width = size[3]-size[1]
>
> -- define array
> points = repeat({0,0}, z)
>
> -- fill array
> for a = 1 to z do
> points[a][1] = rand(width)
> points[a][2] = rand(height)
> end for
> setPenColor( Window1, rand(255*255*255))
> drawPolygon( Window1, True, points)
>
> end procedure
>
> procedure Window1_onClose (integer self, integer
> event, sequence params)
> killTimer ( Window1, PolyTime )
> end procedure
> setHandler(Window1, w32HClose,
> routine_id("PushButton4_onClose"))
>
> procedure Window1_onPaint (integer self, integer
> event, sequence params)
> Polygon()
> Polygon()
> end procedure
> setHandler( Window1, w32HPaint,
> routine_id("Window1_onPaint"))
>
> procedure Window1_onResize (integer self, integer
> event, sequence params)
> setBackColor(Window1, 0)
> repaintWindow(Window1)
> Polygon()
> end procedure
> setHandler( Window1, w32HResize,
> routine_id("Window1_onResize"))
>
> procedure Window1_onTimer (integer self, integer
> event, sequence params)
> ticks += 1
> setBackColor(Window1, 0)
<snip>
> This email was sent to: cafromsw at yahoo.com
>
>
> TOPICA - Start your own email discussion group.
> FREE!
>
>
==^^===============================================================
>
|
Not Categorized, Please Help
|
|