In our previous episode, Howard Page-Clark said:
> > begin
> >    button:=TSpeedButton.Create(self);
> >    button.OnClick:=SpeedButton1Click(button);
> 
> There are two errors.
> 
> button should be a field in the TForm1 class. Declared as a local 
> variable it will be inaccessible after CreateButton() exits.

(he passes self as owner, so strictly speaking it will be accessable via the
form. But indeed it is not common practice.)

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to