Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Slow Hiding Containers

I have a container than contains other containers that are build at runtime
with the addobject function.
This works all perfect except for one thing. When I set the master container
invisible (visible=.F.) it takes a few seconds to hide the container. Setting
visible back to .T. is done without any hesitation.
Anyone has an Idee whats the reason for this and how I could solve this.
[405 byte] By [Anne-Mie] at [2007-11-10 12:49:15]
# 1 Re: Slow Hiding Containers
Hello, Anne-Mie!
You wrote on 22 Apr 2003 08:48:38 -0800:

AM> I have a container than contains other containers that are build at
AM> runtime with the addobject function.
AM> This works all perfect except for one thing. When I set the master
AM> container invisible (visible=.F.) it takes a few seconds to hide the
AM> container. Setting visible back to .T. is done without any hesitation.
AM> Anyone has an Idee whats the reason for this and how I could solve
AM> this.

What kind of objects do you have in the other containers? I ran this test
code and got the following results (Athlon XP1700, WinXP, 512MB):

adding objects: 3.250 seconds
setting visible = .F.: 0.094 seconds

<vfp_code>
loForm = CREATEOBJECT("Form")
loForm.visible = .T.
loForm.addobject("testcontainer1", "testcontainer")
lnSeconds = SECONDS()
FOR lnCount = 1 TO 1000
* add 1000 testcontainers to testcontainer
loForm.testcontainer1.addobject("testcontainer" + ALLTRIM(STR(lnCount)) ,
"testcontainer")
ENDFOR
? "adding objects took", SECONDS() - lnSeconds, "seconds"
lnSeconds = SECONDS()
loForm.testcontainer1.visible = .F.
? "setting visible = .F. took", SECONDS() - lnSeconds, "seconds"

DEFINE CLASS testcontainer as Container
visible = .T.
ADD OBJECT "text1" as textbox WITH ;
visible = .T., ;
value = "Hello World"
ENDDEFINE
</vfp_code>
--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8
Eric den Doop at 2007-11-11 23:51:02 >