[lazarus] Setting callbacks

Samuel Liddicott sam at campbellsci.co.uk
Mon Dec 6 08:39:42 EST 1999




> -----Original Message-----
> From: Michael A. Hess [mailto:mhess at miraclec.com]
> Sent: Sunday, December 05, 1999 08:33 PM
> To: lazarus at miraclec.com
> Subject: Re: [lazarus] Setting callbacks
>
> I would like to see them not be called from in the component itself. For
> example the TButton.CreateWnd now calls the SetCallBack. I myself don't
> like it there because, as you pointed out, it isn't very Delphi like and
> some people coming from the Delphi world wouldn't even understand what
> it was for. I originally was located in TButton.Create and then moved to
> CreateWnd. It was in TButton.Create because it was at that point that
> the actual component/widget whatever was created. Things have really
> changed since then. We now use the CreateWnd and only create the
> component/widget whatever when it is needed. That being the case I would
> like to see the SetCallback moved down into the lowerlevel routines that
> call the components CreateWnd.

What routines would these be?  I think this is a mistake; I am certain that
CreateWnd is the best place to set callbacks/attach events as it is part of
binding the LCL control to its widget-existance, and if it is in CreateWnd
then delphi users don't even need to really be aware of it at all.

> As you pointed out they can use the style
> setting to determine which events need to have callbacks set. As you
> pointed out it doesn't prevent someone from adding a callback that isn't
> standard but there isn't any guarentee that it will be honored.

> My concern was that your statement was that it should be moved out of
> the LCL which I think is a mistake. It should just be at a lower level
> in the classes.

I agree here.

> Once we are sure that every thing is working correctly with SetCallBack
> were it is then I say move it to a lower control level.

I'm curious about what this low level would be.

Sam






More information about the Lazarus mailing list