[fpc-pascal] Re: fpc-pascal Digest, Vol 72, Issue 12
Graeme Geldenhuys
graemeg.lists at gmail.com
Fri Jun 4 08:50:06 CEST 2010
Op 2010-06-04 02:02, Dimitri Smits het geskryf:
>
> Parent and Owner are what they say they are. Owner: the TComponent that
> "owns" the TComponent-descendant. In other words, that is responsible
> for the lifecycle of that instance. Parent: the control on which the
> control is visualised.
I know what they are and what each does. I'm simply saying you don't need
to properties for that. A Parent can just as easily manage the lifespan of
it's chidren as the Owner can. We have listed many such examples in LCL and
VCL already. fpGUI proves this too.
> It is not because by default the LCL or VCL don't keep those in sync in
> most cases, that it is redundant. I've seen plenty in my 10+ Delphi
The most common example normally thrown at me is that docking will not work
if Owner and Parent is always the same. Well, they are wrong. A rudementy
docking implementation using fpGUI once again works just fine (under Linux
and Windows). You simply reparent - which also transfers the ownership
(lifespan control) to the new parent/container component.
> I then conclude from your case above, Graeme, that fpgui does not work
> with containers like TPanel/TGroupbox/... and does not allow to "inject"
> extra visual controls on another form?
And there you are wrong. fpGUI supports all that.
But now this message thread is getting off-topic. My question wasn't about
Parent or Owner, it was why doesn't TWriter output the whole hierarchy of
components when I give it the top level parent (a Form). I think I got my
answer, but that simply raised the point that it's a stupid design (that's
how I see it at least). But as with most things I suggest, it will not be
changed, even if it is a flawed design. Borland and Embarcadero jumps off
the cliff - FPC must now also jump off the cliff. :)
Regards,
- Graeme -
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://opensoft.homeip.net/fpgui/
More information about the fpc-pascal
mailing list