Lazarus

Programming => Operating Systems => macOS / Mac OS X => Topic started by: carl_caulkett on December 06, 2018, 12:37:27 am

Title: What's new?
Post by: carl_caulkett on December 06, 2018, 12:37:27 am
Hi, I've just installed Lazarus 2.0.0RC2 and I'm delighted to see the LLDB based debugging. That's a major step forward, I think.

Could anyone let me know what is the state of play with regard to macOS widgetsets. Last I heard, the long-awaited migration to Cocoa was still a way off, but that the present state of affairs with the Carbon based UI didn't have a long term future. Has any progress been made with Cocoa?

I know that Phil was keen for people to get involved in testing Cocoa, but sadly most of my time in the last few months has been taken up with coding in Golang and making sounds in Ableton!

Of course the major question is whether the Lazarus IDE can be made to reflect the dark theme in Mojave. I do hope so. When I opened up Lazarus earlier this evening for the first time in a few months, it almost scorched my retinas!
Title: Re: What's new?
Post by: Hansaplast on December 06, 2018, 03:14:52 pm
I've been running Lazarus with the Cocoa widget-set for quite a while now (from trunk) and it most certainly has come a very long way - Dmitry has done quite a lot of work when it comes to that. I've been able to develop applications with it without too many problems (see this example (https://www.tweaking4all.com/home-theatre/rename-my-tv-series-v2/)).


Switching themes is detected and handled automatically and works great. When it comes to themes there is still one or the other thing in the IDE that doesn't switch over (bug 34512 (https://bugs.freepascal.org/view.php?id=34512)). Selecting items on a form has significantly improved, but there are a few oddities still there.


Participating in testing and possibly resolving (or assisting in resolving) issues is definitely something that would help, and I've seen (slowly) more people getting involved in that (see the posts in the Cocoa section).


Phil has also made a few units available - which I highly recommend to take a look at. (link (https://macpgmr.github.io/))


I highly recommend testing Lazarus from SVN trunk.
Title: Re: What's new?
Post by: carl_caulkett on December 07, 2018, 02:04:55 am
Thanks for the reply. I've downloaded the SVN build and built it using the Cocoa option, and it runs okay.

What would be nice, however, is if I could copy the config from my Carbon based version which has all the components I want installed and also  has a carefully laid out docked arrangement. I've experimented with copying the files manually and changing file/folder references accordingly but this approach is fraut with errors and I am getting access violations all over the place.

Has any bright spark made a config copy utility, I wonder?
Title: Re: What's new?
Post by: Hansaplast on December 07, 2018, 04:33:15 pm
I'm sure there is a trick for it, I just no longer use the release version - I'm always working with trunk.
I only installed the release version as a fallback and for FPC.


Also: I try to use as much default components - to avoid that development stops for a component that I use often, or for when a component becomes no-longer supported (I love BGRAControls, but I read something about it using OpenGL which Apple is dropping in favor of their Metal engine - but I could be wrong about that).


Others may know how to accomplish what you're looking for.
Title: Re: What's new?
Post by: carl_caulkett on December 07, 2018, 07:20:22 pm
No worries! After a bit of effort, after a good night's sleep, I've installed a few packages with zero hassle, and have got my IDE layout to an acceptable standard...

Title: Re: What's new?
Post by: carl_caulkett on December 07, 2018, 09:12:32 pm
Although I'm getting the odd AV now and again, I'd say that things loook good enough to use Cocoa on a regular basis. There's obviously been some good work done here! I'll see if I can put in the occasional bug report.
Title: Re: What's new?
Post by: garlar27 on December 07, 2018, 10:35:48 pm
What would be nice, however, is if I could copy the config from my Carbon based version which has all the components I want installed and also  has a carefully laid out docked arrangement. I've experimented with copying the files manually and changing file/folder references accordingly but this approach is fraut with errors and I am getting access violations all over the place.

For the component part: You can use OPM (Online Package Manager) it allows you to export/import a list of components and does all the job for you. But I don't know if it works fine on FPC trunk....
Title: Re: What's new?
Post by: Hansaplast on December 08, 2018, 02:30:36 pm
I use the Online Package Manager with trunk - in the beginning I has some issues with OPM but it seems to work fine now. The only thing I have not (tried to) figure is that after an SVN update, and a make clean, I have to do a build Lazarus in the IDE to get my components back. I have tried a few other make builds but they would cause a failure every now and then.
Title: Re: What's new?
Post by: VTwin on December 08, 2018, 03:57:51 pm
Just chiming in on the state of cocoa. I have been using svn cocoa trunk for a few months on a few big projects. While I ran into a few glitches, the progress has been fantastic. I've been trying to report bugs, the more people who do, the better. At this point I am no longer planning to use carbon.

lldb is exciting news, it is working well for me.

As far as I can tell, the cocoa fixes are showing up in trunk (2.1), not 2.0, so I am sticking with trunk for Mac probably until 2.2 is stable. I was trying to report cocoa bugs in 2.0.0RC2, but finding them fixed in 2.1 trunk.

On Win and Lin I'll continue to use the latest stable release, which I run on VirtualBox.   

I do not have Mojave installed yet, so have no experience with the dark theme.

Cheers,
VTwin
Title: Re: What's new?
Post by: Martin_fr on December 08, 2018, 05:07:26 pm
As far as I can tell, the cocoa fixes are showing up in trunk (2.1), not 2.0, so I am sticking with trunk for Mac probably until 2.2 is stable. I was trying to report cocoa bugs in 2.0.0RC2, but finding them fixed in 2.1 trunk.
Wait for RC3
There is a big merge coming up, and RC3 will be soon after.
Title: Re: What's new?
Post by: VTwin on December 08, 2018, 05:29:36 pm
Wait for RC3
There is a big merge coming up, and RC3 will be soon after.

Fantastic!! Very good to know, I'll check out RC3. Thank you for posting.
Title: Re: What's new?
Post by: MISV on December 08, 2018, 05:32:54 pm
Are you doing anything special to make your app dark-theme compatible?

For me buttons, page-tabs, radio-buttons, checkboxes, combobox etc. all fail in various drastic ways (text not visible, background still white etc.)

Like litterally only 5-10% of app looks/works correct on Mojave. I can PM link to app if you want.

I use nested panels/scrollboxes/tpagecontrols if that matters... Maybe some properties need to be set runtime to make it work better?
Title: Re: What's new?
Post by: Hansaplast on December 09, 2018, 04:51:18 pm
I update some of the controls by checking dark/light theme at the onPaint event of the form.
See also this topic (http://forum.lazarus.freepascal.org/index.php/topic,43111.0.html).
But I only need it for controls that do not respond to theme changes like BGRAControls, TStringGrid, and things like icons or images.
Title: Re: What's new?
Post by: MISV on December 10, 2018, 11:42:46 pm
Somehow standard controls are not working at all for me. But as an interim solution I have set a flag in plist file, so I keep Aqua look even if dark theme is selected in Mojave. Better than having everything look all wrong.

I did try to experiment with a few properties like ParentXXX but changing those runtime did not make any difference concerning my problem at least.
Title: Re: What's new?
Post by: VTwin on December 11, 2018, 03:33:51 am
Somehow standard controls are not working at all for me. But as an interim solution I have set a flag in plist file, so I keep Aqua look even if dark theme is selected in Mojave. Better than having everything look all wrong.

I did try to experiment with a few properties like ParentXXX but changing those runtime did not make any difference concerning my problem at least.

I'm concerned about this. For reference, what is the flag you set?
Title: Re: What's new?
Post by: Hansaplast on December 11, 2018, 03:54:13 pm
Interesting ...
When I create a new application, place some standard controls on it like a TButton, TCheckbox, TRadioButton, Tedit, TLabel, run it, and then toggle dark/light mode. This just works out of the box for all these controls.
I'm running Lazarus 2.1.0 r59760 FPC 3.0.4 x86_64-darwin-cocoa (alpha), on MacOS Mojave 10.4.1.
In the past I tried it on High Sierra as well, which worked even there (but no longer have a Mac running High Sierra).


Do you have an example project?


p.s. When creating a new project, I just have it create the out-of-the-box bundle (.app), no special settings in the plist file.
Title: Re: What's new?
Post by: Hansaplast on December 11, 2018, 04:03:36 pm
I've attached 2 screenshot of the simple example I created to test dark/light theme.
Title: Re: What's new?
Post by: Hansaplast on December 11, 2018, 04:05:23 pm
And here the project file for testing.
I did not do anything special.
TinyPortal © 2005-2018