1. Out of breath - second try
- Posted by r.stowasser at web.de Feb 19, 2003
- 452 views
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) repaintWindow(Window1) Polygon() end procedure setHandler( Window1, w32HTimer, routine_id("Window1_onTimer")) procedure PushButton2_onClick (integer self, integer event, sequence params) closeWindow(Window1) end procedure setHandler( PushButton2, w32HClick, routine_id("PushButton2_onClick")) procedure PushButton4_onClick (integer self, integer event, sequence params) setTimer ( Window1, PolyTime, 1000 ) end procedure setHandler(PushButton4, w32HClick, routine_id("PushButton4_onClick")) procedure PushButton6_onClick (integer self, integer event, sequence params) killTimer ( Window1, PolyTime ) end procedure setHandler( PushButton6, w32HClick, routine_id("PushButton6_onClick")) WinMain( Window1,Normal )
2. Re: Out of breath - second try
- Posted by cafromsw at yahoo.com Feb 19, 2003
- 483 views
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! > > ==^^=============================================================== >
3. Re: Out of breath - second try
- Posted by Derek Parnell <ddparnell at bigpond.com> Feb 20, 2003
- 459 views
Hi Roland, >----- Original Message ----- >From: <r.stowasser at web.de> >To: "EUforum" <EUforum at topica.com> >Subject: Out of breath - second try > > >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? [code snipped] Your code is fine and it works well with v0.58.x win32lib. There were some resource bugs that I've fixed up now. Can I use this as a demo for the library? I'll be posting the next win32lib update this weekend after I squash a font bug. ---------------- cheers, Derek Parnell
4. Re: Out of breath - second try
- Posted by Martin Stachon <martin.stachon at worldonline.cz> Feb 22, 2003
- 458 views
Derek, I have win32lib v0.58.00 02/Jan/2003 and when I click start, with task manager I see that with every frame drawn, GDI object usage raises by 2. This can lead to lack of resources soon under Win9x. Martin ----- Original Message ----- From: "Derek Parnell" <ddparnell at bigpond.com> To: "EUforum" <EUforum at topica.com> Subject: Re: Out of breath - second try Hi Roland, >----- Original Message ----- >From: <r.stowasser at web.de> >To: "EUforum" <EUforum at topica.com> >Sent: Thursday, February 20, 2003 3:59 AM >Subject: Out of breath - second try > > >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? [code snipped] Your code is fine and it works well with v0.58.x win32lib. There were some resource bugs that I've fixed up now. Can I use this as a demo for the library? I'll be posting the next win32lib update this weekend after I squash a font bug. ---------------- cheers, Derek Parnell
5. Re: Out of breath - second try
- Posted by Derek Parnell <ddparnell at bigpond.com> Feb 26, 2003
- 464 views
I've fixed this with v0.58.2. Out any day now. ---------------- cheers, Derek Parnell ----- Original Message ----- From: "Martin Stachon" <martin.stachon at worldonline.cz> To: "EUforum" <EUforum at topica.com> Subject: Re: Out of breath - second try Derek, I have win32lib v0.58.00 02/Jan/2003 and when I click start, with task manager I see that with every frame drawn, GDI object usage raises by 2. This can lead to lack of resources soon under Win9x. Martin ----- Original Message ----- From: "Derek Parnell" <ddparnell at bigpond.com> To: "EUforum" <EUforum at topica.com> Sent: Thursday, February 20, 2003 10:31 AM Subject: Re: Out of breath - second try Hi Roland, >----- Original Message ----- >From: <r.stowasser at web.de> >To: "EUforum" <EUforum at topica.com> >Sent: Thursday, February 20, 2003 3:59 AM >Subject: Out of breath - second try > > >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? [code snipped] Your code is fine and it works well with v0.58.x win32lib. There were some resource bugs that I've fixed up now. Can I use this as a demo for the library? I'll be posting the next win32lib update this weekend after I squash a font bug. ---------------- cheers, Derek Parnell ==^^=============================================================== This email was sent to: ddparnell at bigpond.com TOPICA - Start your own email discussion group. FREE!