[[lazarus] CreateComponent]

Michal Bukovjan mbukovjan at netscape.net
Mon Aug 16 13:07:25 EDT 1999


In fact, the GTK object has to be created whenever the fComponent is
addressed, which is in most messages that exist now.

One solution would be to make Component property and GetComponent it's read
method, which would create the component on demand, or have a method like
ComponentNeeded.

The Windows way (of creating controls), however, is VERY different, which
might be a problem. In a Windows control (which is not OO), you supply nearly
all controls' properties at CreateWindow(Ex), and whenever you want to change
a property, you call RecreateWnd. (the rest goes through messages).

In GTK, the components are much like Delphi ones, i.e. they have a sort of
pseudo-properties that can be changed through various functions (they are not
classes or objects to preserve C compatibility, but if you look closely, they
are VERY much like them. In fact, I think they were converted from what once
was a C++ code), without the need (and in fact there is no such thing) to
recreate control. Yes, you can destroy and then create the control once again,
then setup all properties, but this is a DRAG.

Take that into consideration,

Michal Bukovjan


"Samuel Liddicott" <sam at campbellsci.co.uk> wrote:
> It seems like (to pick an example) TLabel makes it's GTK object in the
> contructor.  This is a bit early.
> 
> Can't we delay gtk-creation until HandleNeeded is called?  Its the Delphi
> way.
> In fact can't we do it in the CreateWindow function?
> 
> Am I being too fussy spotting windows divergances here? - but this one is
> important to me.
> 
> Sam
> 
> _________________________________________________________________
>      To unsubscribe: mail lazarus-request at miraclec.com with
>                 "unsubscribe" as the Subject
>     archives at http://www.miraclec.com/list_archives/lazarus






More information about the Lazarus mailing list