Hi,
Can I safely assign a method from an Interface reference to an event
handler. The code below works, but I'm not sure if it is safe to do so,
and allowed.
==================================
TTestApp = class(TObject)
private
rpt: TFPReportReport;
FReportFilter: IFPReportFilter; // can hold any export filter
...
constructor TTestApp.Create;
begin
rpt := TFPReportReport.Create(nil);
rpt.Author := 'Graeme Geldenhuys';
rpt.Title := 'FPReport Demo 4 - Frames and Fonts';
FReportFilter := TFPReportExportPDF.Create; // PDF output
//FReportFilter := TFPReportExportAggPas.Create; // PNG output
rpt.OnRenderReport := @FReportFilter.RenderReport;
...
end;
destructor TTestApp.Destroy;
begin
rpt.Free;
FReportFilter := nil;
inherited Destroy;
end;
==================================
Regards,
Graeme
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/
My public PGP key: http://tinyurl.com/graeme-pgp
_______________________________________________
fpc-pascal maillist - [email protected]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal