Forum > Cocoa

Is Cocoa the future for Lazarus on macOS?

(1/8) > >>

wittbo:
Hi,
since some months I'm working on a cross-platform project; cross-platform means, I would like to get it run on win64 and macOS 64bit. My development platform is macos 10.10 with Lazarus 1.6.4. I started with the carbon widgetset (IDE always carbon), made some experiences with colors, fontsizes and not really working border settings. But ok, the application works fine and can be compiled under WinXP and Win10 without errors. There are some minor adjustments necessary concerning fonts and font sizes and relative adjustments of GUI components, but the result is good enough. The functionality including SQLite database is without any problem.

But what will happen in the future? Within the next one or two years all 32bit applications won't no longer work on actual macOSses. So it seems to me the only way of survival on macOS is migrating to Cocoa 64bit widgetset. So I made my first experiences with Cocoa. IDE stayed on carbon, compiler switch was set to cocoa. Some minor bugs could be handled by workarounds, but then came some severe problems (app crashes on opening a windows OnShow Event, another window only showed less than the half of all visual components, ...). I doubt, that cocoa will ever be a stable platform on macOS. That would mean (for me), that Lazarus will die for macOS within the next two years.

My first Pascal course was in 1981 (may be, I'm an IT grandfather), then stepped into UCDS Pascal with Apple II, followed by  Delphi about 20 years ago. I'm loving this language very much and would do much to help further development for this platform. I'm not a real IT compiler technician and I cannot look very deeply into the secrets of the underlying libraries, but I decided to register for the freepascal bug tracker and to help a little bit to make lazarus-cocoa as a stable pascal software development platform.

mischi:
I disagree with lazarus will die for macOS. I only agree, that it will become more difficult.

First, with the removal of 32-bit carbon, the pressure for cocoa development increases and I expect faster progress.

Second, already now, you can try the 64-bit Qt4-based lcl, which looks pretty good. If this fails, too, the last option is the gtk2-based lcl, which admittedly looks horrible. Both approaches require the installation of additional libraries for the development, but with some effort it is possible to even create standalone applications.

In order to simplify these, I have created package descriptions for fink, a Debian-like package manager, for the Qt4- and gtk2-based lcls. They drag in all what is needed automatically. The currently supported versions are lazarus-1.6.4 and fpc-3.0.2. As soon as newer releases (1.8.0 and 3.0.4) are out, I will update.

However, Xcode and Swift are a tempting alternative.

No reason to despair - MiSchi

Leledumbo:
As time pressure increases, let's hope more contributors are coming to finish the Cocoa widgetset. The better way is to of course find capable contributors and work on it right away.

Phil:

--- Quote from: wittbo on July 16, 2017, 10:25:39 am ---Hi,
since some months I'm working on a cross-platform project; cross-platform means, I would like to get it run on win64 and macOS 64bit. My development platform is macos 10.10 with Lazarus 1.6.4.

--- End quote ---

The Cocoa widgetset code in 1.6.4 is ancient. You need to try 1.8.0 RC3 or, even better, the trunk code:

https://macpgmr.github.io/MacXPlatform/UsingCocoaFromTrunk.html

There are still some gaps and bugs in the Cocoa widgetset, but if you use 1.6.4 you're almost assured that your program won't work with Cocoa.

Phil:

--- Quote from: mischi on July 16, 2017, 12:49:53 pm ---Second, already now, you can try the 64-bit Qt4-based lcl

--- End quote ---

But is that even true anymore? The Qt 4.8.6 package for Mac is now incompatible with El Capitan and later, probably because it tries to put files in /usr/bin. And I was unable to compile the interface framework for 64-bits.

Laz 1.8 includes support for Qt5, as well as the C++ code for compiling the interface framework yourself, but has any Mac user ever gotten that to work? I posed that question here a while back and got no response, so I would guess we know the answer.

No, I don't think that Qt, with or without fink, is a viable answer to new Mac developers who want to try out Lazarus and expect 64-bit Cocoa out of the box.


--- Quote from: mischi on July 16, 2017, 12:49:53 pm ---
However, Xcode and Swift are a tempting alternative.

No reason to despair - MiSchi

--- End quote ---

Apple reported last month that 3 million new developers had signed up in the previous year. Perhaps a few of them were Lazarus users, but probably not more than a handful.

https://www.macstories.net/news/apples-wwdc-keynote-by-the-numbers/

What's your definition of despair?

Navigation

[0] Message Index

[#] Next page

Go to full version