* * *

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

ChrisR

  • Jr. Member
  • **
  • Posts: 58
Re: macOS 32-bit app warning
« Reply #60 on: April 24, 2018, 02:46:15 pm »
LazProgger and dbannon, I understand your viewpoint, but respectfully disagree. There are much more popular tools that provide a OS-independent widgetset. For example, Java, Electron and QT are all mature tools that can be deployed to different operating systems. However, in striving for platform independence they tend to look out of place on all systems. What is impressive about the LCL is that it targets the native widgetset, so the resulting applications look professional and are easy to deploy (having few library dependencies).

This necessarily places some constraints on design, which are documented, e.g.
  http://wiki.lazarus.freepascal.org/Cocoa_Internals/Buttons

The LCL does provide a few widgets that use the Themes drawing (e.g. SpeedButton) - and these will tend to be more platform independent (e.g. they do not use a native base Cocoa class). You can choose these to get a bit more platform independence, but these artificial widgets also tend to need a lot of maintenance, and may look out of place with future OS updates (for example, the MacOS dark mode has revealed some weaknesses with relying on these non-native components).

I personally believe that Lazarus fills a small but important niche providing professional quality, native compiled, native widgetset, low dependency applications. I think the proper solution will be in documenting the way to use anchors to align widgets across platforms. A few tutorials would go a long way here. This is a great start:
 http://wiki.freepascal.org/Anchor_Sides
 http://wiki.freepascal.org/Autosize_/_Layout

As an aside, I think the 1.9 SVN has made terrific strides - Ondrej's DPI-aware TImageList provides a cross-platform method to support high-dpi screens, and Dmitiry's progress on Cocoa has been staggering (building on Felipe's seminal work). There are a few rough edges, but the vast majority of the LCL works. With community help, I think we can push Cocoa out of alpha-state and the next big (2.0?) Lazarus release will be a quantum jump forward.

I also think Hansaplast provided a nice example of how a few minor tweaks could enhance the appearance. Once the foundation of the Cocoa widgetset is finished the community can work on the details. I think it is fantastic that we are now able to focus on these details, it demonstrates the main Cocoa IDE is really coming together.
  http://forum.lazarus.freepascal.org/index.php/topic,39396.90.html
« Last Edit: April 24, 2018, 09:52:07 pm by ChrisR »

dbannon

  • Sr. Member
  • ****
  • Posts: 291
Re: macOS 32-bit app warning
« Reply #61 on: April 25, 2018, 03:15:36 am »
Chris, problem is, the concept of Cross Platform is hard ! Programmers want to write once, users want a familiar looking interface, so a compromise needs to be found. A project with lots of resources can 'afford' to maintain individual platform dependent aspects. But I am working on a project to replace Tomboy Notes. Tomboy is struggling because it cannot find those those disparate resource. I choose Lazarus to replace it because of the "Write Once, Compile Everywhere" promise.

I worry about the (eg) font size problems and now I have to deal with the looming "Cocoa or nothing" threat.  :-\

I suspect the majority of our Cross Platform users have a similar model. But, like you, I would not accept a badly compromised look and feel. Sigh ...

12 months ago I thought Cocoa was something you mixed with hot milk. Now, like Chris, I am excited about the progress that Cocoa has made. Pretty amazing and I thank, very loudly, the people concerned !

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)

Hansaplast

  • Sr. Member
  • ****
  • Posts: 373
  • Tweaking4All.com
    • Tweaking4All
Re: macOS 32-bit app warning
« Reply #62 on: April 27, 2018, 12:07:03 pm »
I agree with Davo.


I'm OK with limitations, like the standard TButton - this helps give the look and feel of Cocoa.
As for the application design, well either I compromise or (if needed) code Cocoa specific (which I'd like to avoid).
Button size is actually not a big deal, one can always divert to TBitButton or create one's own button.


The font size; yeah that's a problem, but I understand this is a PPI issue, which is being worked on. I hope I understood that right.


On that note though; the TMainMenu doesn't work in Cocoa either (running SVN).
I recall from Carbon that one would need to add some code to make a Mac menu - maybe this is something missing with Cocoa as well. Which may be a nice thing to add as a default for Cocoa and/or Carbon. (even though I'm not too concerned with Carbon since it's dying anyway)


I guess the point is:
By default design on any platform (Win/Linux/Mac) and compile it on any other platform (Win/Linux/Mac) without much effort on the UI design. Unless of course one really wants to do something specific for a platform.
Right now (with Cocoa) this simply does not work (yet).

dbannon

  • Sr. Member
  • ****
  • Posts: 291
Re: macOS 32-bit app warning
« Reply #63 on: April 27, 2018, 01:22:11 pm »
Hans, with TMain menu, if you are using an older project in the new SVN, there is another couple of things you need to "transplant" back in the lpi file. In addition to the ones identified in Chris's bug report.

Compare a newly made (from SVN) lpi and your older one, look for lines like "DPIAware" and "Scaled Value", sorry, away from home with now but you will easily spot it when comparing old and new ....

Personally, don't see how such things affect main menu but they do.

But I am seeing a lot of memory leaks and rather coincidently, heaptrc is still crippled on Mac. Sigh ...

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)

dbannon

  • Sr. Member
  • ****
  • Posts: 291
Re: macOS 32-bit app warning
« Reply #64 on: April 28, 2018, 08:01:48 am »
The memory leak I mentioned is associated with TPageControl.
Logged as issue #0033659

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)

Hansaplast

  • Sr. Member
  • ****
  • Posts: 373
  • Tweaking4All.com
    • Tweaking4All
Re: macOS 32-bit app warning
« Reply #65 on: April 30, 2018, 11:58:08 am »
Hans, with TMain menu,...


Thanks Davo - the issue seems to be resolved. TMainMenu is now (in Lazarus 1.9.0 r57735M SVN) working again in Cocoa.
Just a minor issue is that some of the default items do not appear ("Services", "Hide Others" and "Show All").
Probably better to post this in bugtracker?


Cocoa also does not seem to display icons (images) one would puts in front of a menu item, and hovering over a menu item that opens a submenu triggers onclick() (not sure if this is expected behaviour since Carbon does almost the same thing).

dbannon

  • Sr. Member
  • ****
  • Posts: 291
Re: macOS 32-bit app warning
« Reply #66 on: May 01, 2018, 02:13:31 am »
Yes Hans, I can confirm that missing block in the the project's menu. Has been like that for some time, as long as I have been playing with Cocoa perhaps ?  It does not worry me as those options are not really relevant to my app but as we know, Mac users have certain expectations ...

So, it is a bug but probably just a minor one. { Mind you, they called the ones we thought very important "minor". Not sure what would be needed to be greater than "minor" ? ;)  }

Anyway. yep. it would help to make Lazarus on Mac just that bit more polished.

I have my app running pretty well now under Cocoa, minor memory leak in TPageControl but it looks and feels pretty good. We sure have seen a huge improvement in the last couple of months !

Davo
Lazarus 1.8, Linux (and reluctantly Win10, OSX)

Gilles

  • New member
  • *
  • Posts: 28
Re: macOS 32-bit app warning
« Reply #67 on: May 02, 2018, 02:09:23 pm »
Hello

by the way…

is there any project-example, built to run with xcode, and to target 64bit High Sierra ?

(a basic project, to put a "hello word"… I don't success in begining a new project in Pascal with xcode 9.1
TurboPascal -> ThinkPascal -> CodeWarrior -> XCode with FPC -> (Well-deserved) Retirement (but not yet, not yet…)

Phil

  • Hero Member
  • *****
  • Posts: 2749
Re: macOS 32-bit app warning
« Reply #68 on: May 02, 2018, 02:22:55 pm »
is there any project-example, built to run with xcode, and to target 64bit High Sierra ?

See the ProjectXC article here:

https://macpgmr.github.io

Gilles

  • New member
  • *
  • Posts: 28
Re: macOS 32-bit app warning
« Reply #69 on: May 02, 2018, 02:40:18 pm »
aahhh merci merci merci  :D

and is there any way to add colors for key-words (like "begin" "end" and so on ) ?
« Last Edit: May 02, 2018, 02:54:47 pm by Gilles »
TurboPascal -> ThinkPascal -> CodeWarrior -> XCode with FPC -> (Well-deserved) Retirement (but not yet, not yet…)

Phil

  • Hero Member
  • *****
  • Posts: 2749
Re: macOS 32-bit app warning
« Reply #70 on: May 02, 2018, 02:54:59 pm »
aahhh merci merci merci  :D

and is there any way to add colors for key-words (like "begin" "end" and so on ) ?

Yes, see article.

Gilles

  • New member
  • *
  • Posts: 28
Re: macOS 32-bit app warning
« Reply #71 on: May 05, 2018, 04:13:40 pm »
Cool and merci again

the tool didn't work
but by doing it, following what it was supposed to do, the result was  perfect

(by the way : I miss CodeWarrior, where you could have several colored lists of key-words and not just only one…)
« Last Edit: May 05, 2018, 04:59:08 pm by Gilles »
TurboPascal -> ThinkPascal -> CodeWarrior -> XCode with FPC -> (Well-deserved) Retirement (but not yet, not yet…)

jwdietrich

  • Hero Member
  • *****
  • Posts: 971
    • formatio reticularis
Re: macOS 32-bit app warning
« Reply #72 on: May 05, 2018, 05:06:57 pm »
(by the way : I miss CodeWarrior, where you could have several colored lists of key-words and not just only one…)

Do you know that you can change and even define color schemes in Lazarus? See http://wiki.lazarus.freepascal.org/UserSuppliedSchemeSettings.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 1.8.4 | FPC 3.0.4 | PPC, Intel, ARM | macOS, Windows, Linux

Gilles

  • New member
  • *
  • Posts: 28
Re: macOS 32-bit app warning
« Reply #73 on: May 06, 2018, 09:17:35 am »
In CodeWarrior, I had defined a color for all Mac Routines, another for Pascal key-words, one for numbers, and so on
I found only one key-words list in XCode and it is used for Pascal key-words (et c'est déjà pas mal ;) )
I don't know Lazarus… more than one list of key-words in Lazarus ?
TurboPascal -> ThinkPascal -> CodeWarrior -> XCode with FPC -> (Well-deserved) Retirement (but not yet, not yet…)

VTwin

  • Sr. Member
  • ****
  • Posts: 438
  • Former Turbo Pascal 3 user
Re: macOS 32-bit app warning
« Reply #74 on: May 15, 2018, 07:38:21 pm »
@skalogryz
Thanks, I will work on that. Is that something I should post in lazarus bugtracker?
Bugtracker is the best, but posting them here would work as well

I have been too busy to do much on this, but have tried a few controls now. I was pleasantly surprised to find that TScrollBar, TPaintbox, and TDrawGrid are in pretty good shape. I'll try to do further testing on them.

TImageList does not work in Cocoa though, so I have attached a simple project to demonstrate. I'll post it in BugTracker as well.

Cheers,
VTwin


EDIT: Responding to some of the thread here, I develop on Mac, and then deploy on Win and Lin as well. I have no desire to spend the time learning XCode and Swift and limit my audience. With literally 1000s of happy customers, the Lazarus approach has served me well. I spent a decade or so in REALbasic (aka Xojo), simply because it cross-compiled, but it was slow among many other limitations. So glad to to have made the switch.
« Last Edit: May 15, 2018, 08:16:06 pm by VTwin »
“Talk is cheap. Show me the code.” Linus Torvalds

Lazarus 1.8.4, FPC 3.0.4
macOS 10.11.5 (32 bit Carbon, working on Cocoa) 
Windows 7 (64 bit)
Ubuntu 16.04.3 (64 bit)

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus