Board index » cppbuilder » Thanks for the help.

Thanks for the help.


2006-08-20 01:15:03 PM
cppbuilder49
OK, Gambit
Thanks for the help.
Quote
You are making a typical newbie mistake. You are not setting the Parent
property of each new Panel instance.
I though that I had defined the Parent when I included "this" as the calling
argument,
but apparently, that is the Owner and not the Parent.
PanelBars[i] = new TPanel( this );
So now I have the panels displayed and I can procede.
But I have one more point of confussion,
Do need to delete these Panels, or
will they be deleted automatically by the Parent???
 
 

Re:Thanks for the help.

"Wayne Fuqua" < XXXX@XXXXX.COM >wrote:
Quote

Please do not change the subject line. It breaks the thread
when it is archived.
Quote
But I have one more point of confussion, Do need to delete
these Panels,
Only if your design requires that they be destroyed before the
application (or form) is destroyed.
Quote
or will they be deleted automatically by the Parent???
Actually, the Owner is responsible for memory management so
when the Owner is destroyed, all of the objects that it ownes
will also be destroyed. The Parent is responsible for screen
management but it too will destroy all objects that it Parents
so it's possible to a NULL Owner and still have the object
automatically destroyed.
~ JD
 

Re:Thanks for the help.

"Wayne Fuqua" < XXXX@XXXXX.COM >wrote in message
Quote
Do need to delete these Panels, or
will they be deleted automatically by the Parent???
They are automatically freed by the Owner.
Gambit
P.S. for future reference, please post your replies in the original
discussion thread that you are replying to. Do not start a new thread
unless you are starting a new topic of discussion.
 

{smallsort}