Recent

Author Topic: macOS 32-bit app warning  (Read 27691 times)

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: macOS 32-bit app warning
« Reply #45 on: April 23, 2018, 08:54:51 am »
Bug Reports

Just tp be clear, (I was not initially) - I have logged two bug reports for Trunk, one against Carbon and one against Cocoa but I am convinced its the same underlying problem.

Carbon - an application does not interact if run from the IDE #0033627
Cocoa - an application run from the IDE does not put its Menu in place nor show an icon in the dock. #0033634

I have narrowed this all down to svn r56760, that seems to stop all running from within IDE, partially fixed (ie the way we see it now) in r56771. This was mid December. And the stuff being committed does not seem at all likely to cause what we are experiencing. To me. Good thing I don't have commit access  ;)

Seems a long time for no one else to have picked it up ....

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Josh

  • Hero Member
  • *****
  • Posts: 1271
Re: macOS 32-bit app warning
« Reply #46 on: April 23, 2018, 09:40:54 am »
Just a thought, have you created the application bundle when targeting mac?
Option is under project option.
All Mac GUI should be run from the bundle; not the compiled binary.
the bundle has a link back to the compiled binary which will not be in the bundle, when you want to use this bundle to distribute or create a dmg etc; you will need to replace the link in the bundle with the binary.
if you click the bundle and explore the package; you will see it has folders and files in it, you can for example add libraries, fonts in the bundle and the plist.info file can hold information like app version, package icon etc etc.


The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: macOS 32-bit app warning
« Reply #47 on: April 23, 2018, 11:03:51 am »

I think, the cocoa widgetset should be designed to look similar in sizes and proportions so that you can reuse your Windows or Linux code without modifications - and like it is for carbon today. Other implementations would make no sense.
Totally agree ... or at least: this is how I'd like to see it as well.
However the devs appear to be aiming to match XCode - for example font size = 8 in XCode is much smaller than in Carbon/Windows/Linux.
Right now, in Cocoa's current state, I have to do this to make the font size match:


Code: Pascal  [Select][+][-]
  1.   procedure fixCocoaLabels;
  2.     var FontCorrection:Double;
  3.         Counter:integer;
  4.     begin
  5.       FontCorrection := 11/8;
  6.       for Counter:=0 to self.ComponentCount-1 do
  7.         if self.Components[counter] is TLabel then
  8.           TLabel(self.Components[counter]).Font.Size:=trunc(FontCorrection*tmpLabel.Font.Size);
  9.     end;      


Obviously this is not the way to do this ... it makes it for a poor way to design a UI, since you can't see it at design time if the IDE ever runs reliable under Cocoa. But even worse of course when the size rules change at a later time.
Before spending hours on designing things the wrong way ... what does the Lazarus Dev team think of this?
I can't seem to get a clear statement ...

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2770
    • havefunsoft.com
Re: macOS 32-bit app warning
« Reply #48 on: April 23, 2018, 02:53:38 pm »
However the devs appear to be aiming to match XCode - for example font size = 8 in XCode is much smaller than in Carbon/Windows/Linux.
If you're using the trunk, you should be able to do it in the following manner:
Code: Pascal  [Select][+][-]
  1. uses  ...
  2.   {$ifdef LCLCocoa}
  3.   , CocoaInt
  4.   {$endif};
  5.  
  6. initialization
  7.   {$ifdef LCLCocoa},
  8.   CocoaBasePPI := 72;
  9.   {$endif}
  10.  
It will not help with designed controls, but changing font in run-time will match Xcode.

Starting with 1.8 release, the Cocoa (and Carbon) PPI is 96, rather than 72.
Thus LCL selected fonts of the a particular size (in points) would not match the same font and the same size selected in Xcode or TextView.

I was trying to resolve the issue on case-by-case basis, however cross-platform needs took over. And 96 ppi rule remains.
The code above however allows to switch Cocoa back from 96 to 72 for run-time.
« Last Edit: April 23, 2018, 02:56:58 pm by skalogryz »

ChrisR

  • Full Member
  • ***
  • Posts: 247
Re: macOS 32-bit app warning
« Reply #49 on: April 23, 2018, 04:27:39 pm »
dbannon, regarding issue 33634, I think this is a replication of 32888. Does changing the lpi file as noted in that issue fix your problem?

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: macOS 32-bit app warning
« Reply #50 on: April 23, 2018, 11:55:38 pm »
It will not help with designed controls, but changing font in run-time will match Xcode.

Starting with 1.8 release, the Cocoa (and Carbon) PPI is 96, rather than 72.
Thus LCL selected fonts of the a particular size (in points) would not match the same font and the same size selected in Xcode or TextView.

I was trying to resolve the issue on case-by-case basis, however cross-platform needs took over. And 96 ppi rule remains.
The code above however allows to switch Cocoa back from 96 to 72 for run-time.


Thanks skalogryz - I'll give that a try.
And thanks for the PPI explanation.  :)


Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: macOS 32-bit app warning
« Reply #51 on: April 24, 2018, 12:03:45 am »

@ skalogryz ;
Where do I put this part of the code?


Code: Pascal  [Select][+][-]
  1. initialization
  2.   {$ifdef LCLCocoa}
  3.   CocoaBasePPI := 72;
  4.   {$endif}
  5.  


I have tried several places (the "uses" seems to work fine) but keep getting the error: Identifier not found "CocoaBasePPI"

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: macOS 32-bit app warning
« Reply #52 on: April 24, 2018, 12:08:16 am »
Where do I put this part of the code?

It's in the CocoaInt unit, so be sure to include it in your uses.

Make sure you're using the latest trunk source. cocoaint.pas was modified on April 19.

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: macOS 32-bit app warning
« Reply #53 on: April 24, 2018, 03:20:54 am »
dbannon, regarding issue 33634, I think this is a replication of 32888. Does changing the lpi file as noted in that issue fix your problem?

Yes Chris, you got it in one! I have answered you in the bug tracker but for benefit of people reading this thread -

The problems running Carbon or Cocoa applications from within Lazarus is a know issue, #0032888. There is even an ugly workaround (most workarounds are ugly !). You can manually edit a small section of your project's LPI file, it does not seem to affect earlier releases.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: macOS 32-bit app warning
« Reply #54 on: April 24, 2018, 09:40:19 am »
It's in the CocoaInt unit, so be sure to include it in your uses.
Make sure you're using the latest trunk source. cocoaint.pas was modified on April 19.


Awesome that did the trick.  :D

LazProgger

  • Full Member
  • ***
  • Posts: 103
Re: macOS 32-bit app warning
« Reply #55 on: April 24, 2018, 10:59:04 am »
However the devs appear to be aiming to match XCode - for example font size = 8 in XCode is much smaller than in Carbon/Windows/Linux.

But what is the reason for matching XCode?

I think, most Lazarus users on macOS are cross-platform developers coming from Windows or Linux and want to make their programs run also on a Mac. Someone who is only developing for Mac and known to XCode and the Mac world, would probably rather use XCode directly and not Lazarus.

So, in my opinion, Lazarus should better fit those cross platform developers to make their lifes easier, because this is something XCode cannot do and is Lazarus unique selling point, even for users coming from the Mac and wanting their code also porting to Windows or Linux. Those people would probably not thing "Oh I want to use the same font size like in XCode" but "Oh cool I can reuse my code for all platforms without any modifications!".
« Last Edit: April 24, 2018, 11:06:36 am by LazProgger »

dbannon

  • Hero Member
  • *****
  • Posts: 2786
    • tomboy-ng, a rewrite of the classic Tomboy
Re: macOS 32-bit app warning
« Reply #56 on: April 24, 2018, 11:07:53 am »
Quote
I think, most Lazarus users on macOS are cross-plattform developers coming from Windows or Linux and want to make their programs run also on a Mac.

Yes, I agree. Lazarus - Write Once - Compile Anywhere, Lazarus's slogan and feature. Its the one thing (IMHO) that Lazarus is far better at than any alternative. Its silly trying to compete directly with (eg) XCode, better to play to our strengths and ensure absolutely minimum changes between platforms.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

LazProgger

  • Full Member
  • ***
  • Posts: 103
Re: macOS 32-bit app warning
« Reply #57 on: April 24, 2018, 11:12:22 am »

Lazarus - Write Once - Compile Anywhere, Lazarus's slogan and feature. Its the one thing (IMHO) that Lazarus is far better at than any alternative. Its silly trying to compete directly with (eg) XCode, better to play to our strengths and ensure absolutely minimum changes between platforms.

Davo

I absolutely agree. That is Lazarus' gap in the market and that should be what we should have in mind wherever possible.

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: macOS 32-bit app warning
« Reply #58 on: April 24, 2018, 11:23:08 am »
Quote
I think, most Lazarus users on macOS are cross-plattform developers coming from Windows or Linux and want to make their programs run also on a Mac.

Yes, I agree. Lazarus - Write Once - Compile Anywhere, Lazarus's slogan and feature. Its the one thing (IMHO) that Lazarus is far better at than any alternative. Its silly trying to compete directly with (eg) XCode, better to play to our strengths and ensure absolutely minimum changes between platforms.

Davo


Completely agree ...
I have used Lazarus for several years now, comming from Delphi, and it's strength is that I develop an application on one platform (typically Mac by the way) and recompile it on Linux and Windows without too much effort. For me this has been one of it's strengths and I have not found that there is no alternative that can match this (IMHO - unless you count Xojo, but that's just not my cup of tea).
So I don't even care if it matches XCode or not (I don't even like XCode) - it's not even relevant.
As long as I can design my application on one platform and deploy it on another without having to tinker with the UI too much.
I think completion of the Cocoa widgetset will be a great win - but I realize it takes a lot of work (much gratitude and respect for all the devs).

LazProgger

  • Full Member
  • ***
  • Posts: 103
Re: macOS 32-bit app warning
« Reply #59 on: April 24, 2018, 11:40:22 am »
I hope some of the developers involved in the cocoa implementation are reading this...

 

TinyPortal © 2005-2018