[lazarus] Setting callbacks

Marc Weustink weus at quicknet.nl
Sun Dec 5 16:48:37 EST 1999


At 15:32 05-12-99 -0500, Michael A. Hess wrote:
>Marc Weustink wrote:
>> 
>> If this is indeed the point where LCL differs from VCL, I'll introduce
>> T(win)Control.AttachEvents and T(win)Control.DetachEvents and that
>> would be the place to call SetCallBack
>
>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. 

Thats the reason I came with T(win)Control.AttachEvents. At this place the
SetCallbackCalls are made. And gets called somewhere in the line of Handle
to CreateWnd. I personally was thinking of a call in CreatWnd, but there
might be a "deeper" function

>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 start seeing that. Sometimes you have half an idea and you need to talk
to someone to see the pros and cons

>I am for this move but think some other things need to be cleaned up
>first. Or shall I say get working. I myself haven't been digging around
>to much due to lack of time on my part but it has been pointed out to me
>that many of the previous controls and components that previous worked
>no longer do so. Take TButton for example. This doesn't even show up in
>any of the example programs any more. I assume this came about due to
>the change to CreateWnd but I hope we can get this working again.

Some controls (wich arent used in lazarus itself) still create and
setcallbacks in the constructor. Since I use the lazarus.pp as check if
everything wors I hadn't seen them. I'll look at the examples. 
BTW buttons not correctly showing is fixed

>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.

That was what I had in mind first and the reason I wrote this.

>
>What say thee???
>
>-- 
>==== Programming my first best destiny! ====
>
>Michael A. Hess      Miracle Concepts, Inc.
>mhess at miraclec.com   http://www.miraclec.com
>
>_________________________________________________________________
>     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