[lazarus] More on the Self and buttons behavior

Curtis White osiriz at teleport.com
Sun Aug 8 12:54:46 EDT 1999


That might be why my compileroptions dialog button started crashing. In the
OnClicked event, I just had Hide, which really means Self.Hide. So if Self
refers to the button instead of the form, then it would be telling the button
to hide. I don't quite know why this caused Lazarus to crash, but it definitely
isn't right. Like you said, Self should refer to the class component and Sender
should refer to the object that called that method. I don't know what happened
to change this though. It was working yesterday.


Curtis

On 07-Aug-99 Michael A. Hess wrote:
> Now this isn't correct. If you look in the dlgform.pp file of the
> comdialogs example you will see the buttonClick which is the procedure
> called by the DoOnClick TNotifyEvent. It looks like this:
> 
> procedure TSampleDialogs.buttonClick(Sender : TObject);
> begin
> .
> .
> .
> end;
> 
> In the above case shouldn't the variable Self as found in this method
> represent a pointer to the SampleDialogs object that was created from
> the TSampleDialogs class? Then the data in the Sender field should be
> the pointer to the actual TObject (aka control) that called this event.
> 
> However the Self that is found is actually the button that fired the
> event. If you just print the caption and tag "writeln(caption,'  ',tag);
> you will see that it prints the name of the button and the tag value
> when you click on the button. But it shouldn't. It used to.
> 
> What happened?????
> -- 
> ==== 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

----------------------------------
Curtis White
Curtis White <osiriz at teleport.com>
http://www.teleport.com/~osiriz/
----------------------------------






More information about the Lazarus mailing list