Lazarus

Programming => Widgetset => Cocoa => Topic started by: Dan3468298 on June 30, 2020, 02:56:10 pm

Title: MacOS 10.15.5 Printer Class Crash?
Post by: Dan3468298 on June 30, 2020, 02:56:10 pm
Just tried the https://wiki.freepascal.org/Using_the_printer example and Printer unit error'd out and crashed at line 702.   What is status of printing on MacOS 10.15.5?   
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: Dan3468298 on July 01, 2020, 01:58:03 pm
Is a Bounty needed to get printing working on MacOS?
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: rvk on July 01, 2020, 02:20:28 pm
Is a Bounty needed to get printing working on MacOS?
Or file a Bug Report.

Are you using trunk? Otherwise it might already be solved.
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: Dan3468298 on July 01, 2020, 05:29:20 pm
I am using 2.0.8 Release Build 2020-04-15.   Is printing supposed to work in this release?
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: Dan3468298 on July 01, 2020, 10:15:12 pm
Filed Bug Report 0037291.
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: trev on July 02, 2020, 12:22:15 am
According to  Status of features on each LCL Interface (https://wiki.freepascal.org/Roadmap#Status_of_features_on_each_LCL_Interface Status_of_features_on_each_LCL_Interfacel) printing is not implemented in Cocoa and only partially implemented in Carbon.
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: Dan3468298 on July 02, 2020, 04:34:31 am
So how to induce?  I saw article about bounties but see no link to set one up.
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: rvk on July 02, 2020, 06:36:23 am
I thought printing under cocoa is continuously being worked on.

See the bugreports for the persons doing it.
At least the printers.pas unit should give an error during compile.

And https://forum.lazarus.freepascal.org/index.php/topic,48465.msg348965.html#msg348965

For bounties you can edit the wiki/bounty page yourself.
https://wiki.lazarus.freepascal.org/Bounties

I am using 2.0.8 Release Build 2020-04-15.   Is printing supposed to work in this release?
BTW, it's better to use the trunk version so you can get the fixes directly. Otherwise you might need to wait a long time for each fix to reach a release version of Lazarus.

The bugfixes are applied directly to trunk. After that it might take some time for them to be added to 'fixes' (if the fix is worthwhile). And even longer for it to reach final release version.

Chances are the printer-unit is already fixed (or at least doesn't error out) in trunk.
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: PascalDragon on July 02, 2020, 09:45:07 am
For Cocoa you might also want to support skalogryz directly on Patreon (https://www.patreon.com/skalogryz) ;)
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: Dan3468298 on July 02, 2020, 05:18:49 pm
What's the best way to install Trunk version for a newbie?  Also, I see reference to a Fixes_2_0 that can be installed with fpcupdeluxe. 
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: rvk on July 02, 2020, 05:24:21 pm
What's the best way to install Trunk version for a newbie?  Also, I see reference to a Fixes_2_0 that can be installed with fpcupdeluxe.
fpcupdeluxe would be the easiest way.
I would install trunk for cocoa development purposes (because the fixes some faster).
When one of the bug reports get fixed you can just update it and you have the fix. Otherwise you would need to wait.

When the fixed reach the fixes-branche you could use one of those for a more stable release.

(Sometimes trunk gets broken but usually it gets fixed right away)
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: Dan3468298 on July 02, 2020, 05:45:37 pm
OK, will try to install Trunk and 2.0.8 side by side and use fpcupdeluxe for Trunk.  Any gotchas I need to be aware of if following the documentation?  Thanks!
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: rvk on July 02, 2020, 06:12:46 pm
OK, will try to install Trunk and 2.0.8 side by side and use fpcupdeluxe for Trunk.  Any gotchas I need to be aware of if following the documentation?  Thanks!
Not that I know of. I don't use fpcupdeluxe myself because I have my own Windows and Linux script to install it.

Make sure to choose secondary installation (if you can) so that it has its own config. That way it doesn't mess with you config from 2.0.8.
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: skalogryz on July 03, 2020, 01:50:56 am
Just tried the https://wiki.freepascal.org/Using_the_printer example and Printer unit error'd out and crashed at line 702.   What is status of printing on MacOS 10.15.5?
do you've printer4lazarus used by the project? (see attachments)
(note that "uses... printers" is not the use of printer4lazarus component)
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: dbannon on July 03, 2020, 02:25:22 am
According to  Status of features on each LCL Interface (https://wiki.freepascal.org/Roadmap#Status_of_features_on_each_LCL_Interface Status_of_features_on_each_LCL_Interfacel) printing is not implemented in Cocoa and only partially implemented in Carbon.

I only test on Sierra (on Mac) but with that, Coco printing works fine.  But I am printing only Text.

Davo
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: trev on July 03, 2020, 02:41:49 am
I rarely use a printer anymore, maybe once in the last year. I believe I ran this test on Mojave with Lazarus trunk in December last year (judging by the dates on the files) and it worked, but again only text.

Code: Pascal  [Select][+][-]
  1. procedure TForm1.TestButtonClick(Sender: TObject);
  2. begin
  3.     Printer.Title := 'Test';
  4.     Printer.BeginDoc;
  5.     try
  6.       Printer.Canvas.Font.Name := 'Arial';
  7.       Printer.Canvas.Font.Size := 9;
  8.       Printer.Canvas.Font.Style := [];
  9.       Printer.Canvas.Pen.Color := clBlack;
  10.       Printer.Canvas.Pen.Width := 2;
  11.       Printer.Canvas.TextOut(150, 150, 'Test of printing function');
  12.     finally
  13.       Printer.EndDoc;
  14.     end;
  15. end;
  16. end.
  17.  
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: Dan3468298 on July 03, 2020, 11:28:37 pm
Please see the bug report.   
Title: Re: MacOS 10.15.5 Printer Class Crash?
Post by: rvk on July 06, 2020, 06:17:30 am
Please see the bug report.
https://bugs.freepascal.org/view.php?id=37291

(You should close the issue there if it's resolved for you, with the close button on that page)
TinyPortal © 2005-2018