Recent

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

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: macOS 32-bit app warning
« Reply #30 on: April 20, 2018, 04:55:55 am »
With (2), perhaps it's just lost the focus? When you click on the app on the Dock, does the app's menu appear?
No, clicking the icon in the 'Dock" (see, I'm learning), does not appear to do anything.

It is possible to see apps on Mac where just the menu bar appears - example: TextEdit. But these apps don't do it by hiding the window. Rather, the window is not yet open. See if that works for you. Hiding the window seems like an odd thing to do.

On second thought, that might be an LCL oddity: when you close the main window, the app closes. Mac apps don't normally behave like that. So perhaps hiding the window is your workaround for LCL peculiarities?

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: macOS 32-bit app warning
« Reply #31 on: April 20, 2018, 06:36:17 am »
Yes Phil, I have done it like it is because of a (self imposed) constraint of being cross platform with minimal code unique to one platform.

The Linux and Windows version of the  app use the tray icon but I quickly discovered it did not really produce a Mac like experience and, on the Mac, leaked like a sieve ! So, I have a main menu that duplicates the tray icon popup menu and some ifdef-ing to handle the different platforms. It results in  pretty simple transition between Mac and the other two.

I don't quite see how a menu can be displayed before the Form its associated with is created ? Maybe thats just not the way LCL thinks ?   I suppose I could transfer "main-ness" to another, simple form that does show and move the Mac menus there but it would mean a different look and feel (and quite a lot of different code) between platforms.

Sad thing is, it does work quite well using Carbon ....

I do wonder if this specific problem will go away if and when the "don't show menu when debugging" is fixed. They are, to some degree, similar.  :-\

The Application itself is a replacement for the old Tomboy Notes, a Mono app that has lost much of its user base. For a long time it had a separate Mac stream, some common code but was evolving into a different beast and became abandon ware (the Mac part I mean).

So, in discussion, I quoted the "write once, build anywhere" slogan and the rest, as they say, is history.

David
Lazarus 2, Linux (and reluctantly Win10, OSX)
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 #32 on: April 20, 2018, 11:58:03 am »
I have been trying for a while now to develop my applications with Cocoa and just keep running into the same issues.
Also note that I've asked this question before, so feel free to ignore this message ...


In the past, when creating an application for Windows, Linux and MacOS (Carbon), I enjoyed the luxury of designing my application on one platform (typically MacOS) and then copy the sources to a Linux or Windows VM to simply recompile it.
This always worked very well - the user interface design matched beautifully on all 3 platforms. Sure there are some small differences like the shape of a button or the tabs on a TPageControl. But in the end, things were placed the same way (position/size), fonts were the same size, etc.


With current Cocoa development this is no longer the case.
Fonts are smaller, TPageControl is not even the same width, etc. (I've posted examples and corrections in other posts)
I understand that the goal of the developer(s) involved is to match a design of XCode as close as possible. With all respect to them, since they do a lot of great work for which I'm very grateful, but is this the route Lazarus is going to follow?
On top of that: Cocoa is not (yet) mature enough for use with the IDE (designtime), so I find myself having to work with Carbon (or a different platform like Windows) to find out that all my work has to be corrected to make it look comparable in Cocoa.


I guess what I'm asking is; to accomplish the ability to develop for 3 platforms (Windows, Linux and MacOS Cocoa);
- Should I add additional compiler directives to modify width, height, margins, font size etc. so my design works on all 3 platforms?
- Or will there be an alternative working method (match LCL or match XCode)?
- Or would it be better to make Cocoa look closer to the design no matter what platform we use (of course with the exception of buttons shapes or size, tabs shape for TPageControl)?


The current direction makes it a pain to modify all my existing apps to move to Cocoa, and development of cross platform applications in the future will be a pain as well.


Just to be clear; nothing but great respect for the developers!
They are doing a great job which as usual is greatly under-appreciated.


I'd just like to know what the right way to develop a UI for my applications will be.

mischi

  • Full Member
  • ***
  • Posts: 170
Re: macOS 32-bit app warning
« Reply #33 on: April 20, 2018, 01:06:55 pm »
I do not really know, whether this helps, but you might also try Qt4 or even Qt5 on macOS. Maybe, they need less modifications.

So far, I have done only a small hobby project for win, linux and macOS (carbon). Even then, i needed a small number of adjustments and created an extra unit with the platform specific values.

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: macOS 32-bit app warning
« Reply #34 on: April 20, 2018, 02:07:30 pm »
Thanks Mischi,


I did explore Qt as well - not too thrilled with the need to install or include the Qt framework though.


I'm doing small hobby projects as well, that sometimes spin out of control  :D . I offer the apps for free on my website and before you know it they get downloaded tons of times. One of my apps has been downloaded more than 500,000 times  :o .

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: macOS 32-bit app warning
« Reply #35 on: April 21, 2018, 02:43:13 am »
Quote
..... When you run it from within the IDE, an app's main menu is, not shown across the top and an icon for the app is not shown in the Dock. Only interaction with the running app is to close (or full screen) it. But you can grab a terminal and 'open' the same compiled binary and it does work normally, the problem is only when running from within the IDE.

OK, I have determined this problem is Mac only. It shows up on a Carbon IDE and (via Phil) a Cocoa IDE.

But more worryingly, I have gone back two weeks (57612) and then six weeks (57426) and its still there !   In that time there have been a lot of commits, including quite a lot addressing Cocoa. So, maybe the people doing those commits are using an older (ie 1.8 release) IDE but working on, perhaps the trunk LCL ?

Six weeks seems a long time for this problem to go unnoticed ?

Could one other Mac user please confirm ?  Its pretty easy as long as you already have a working Lazarus 1.8 and its won't mess with your existing install.

In a terminal, go somewhere suitable and -
Code: Pascal  [Select][+][-]
  1. mkdir laz-svn
  2. cd laz-svn
  3. svn checkout https://svn.freepascal.org/svn/lazarus/trunk .
  4. make CPU_TARGET=i386
  5. open lazarus.app --args "--pcp=~/.laz-svn"

Check the setting and click "start IDE"
Then click Options, scroll down to Debugger->General and paste
Code: Pascal  [Select][+][-]
  1. "--eval-command=set startup-with-shell off"
(inc the ") into the field "Debugger specific Options" and, IMPORTANT, press <enter> at the end of the line.  Save.

Paste a button (or anything) into the blank form thats been waiting for you to come back, click the green 'Run' icon and, when the running form is displayed, can you interact with it ?

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
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 #36 on: April 21, 2018, 10:34:44 am »

I have these 2 Lazarus versions running (version info copied from the "About" window with right click):
  • Lazarus 1.8.2 rexported FPC 3.0.4 i386-darwin-carbon (is "rexported" a typo?)
  • Lazarus 1.9.0 r57663 FPC 3.0.4 i386-darwin-carbon
I have to run the IDE in 32 bit Carbon since the IDE is not workable in 64 bit Cocoa (see also my previous post/question).


For 64 bit I must set the compiler to /usr/local/bin/fpc, for 32 bit /usr/local/bin/ppc386 - otherwise I get an error message.
So when building the IDE the compiler must be "ppc386", but when I build a 64bit application I must switch to fpc again (maybe an issue with my setup of course).
When I create a new application, and simply right away run it ...


Lazarus v1.8.2:
64 bit Cocoa: the icon appears in the dock and the menu is visible (but the menu is empty - there are no items!).
32 bit Carbon: the icon appears in the dock and the menu is visible (this time with the default items like services, quit, etc!).


Lazarus 1.9.0 SVN:
64 bit Cocoa: no dock icon, and no menu.
32 bit Carbon: no dock icon, and no menu, can't even get the main form to get focus.


Devs: please feel free to contact me if you'd like me to test something - I'd be more than happy to help and test wherever I can.
Since SVN is always under development, I have learned to not jump the gun right away and just be patient for a couple days when something doesn't work, or for example when I cannot compile the IDE.

Hansaplast

  • Hero Member
  • *****
  • Posts: 674
  • Tweaking4All.com
    • Tweaking4All
Re: macOS 32-bit app warning
« Reply #37 on: April 21, 2018, 10:46:18 am »
In a terminal, go somewhere suitable and -
Code: Pascal  [Select][+][-]
  1. mkdir laz-svn
  2. cd laz-svn
  3. svn checkout https://svn.freepascal.org/svn/lazarus/trunk .
  4. make CPU_TARGET=i386
  5. open lazarus.app --args "--pcp=~/.laz-svn"

Check the setting and click "start IDE"
Then click Options, scroll down to Debugger->General and paste
Code: Pascal  [Select][+][-]
  1. "--eval-command=set startup-with-shell off"
(inc the ") into the field "Debugger specific Options" and, IMPORTANT, press <enter> at the end of the line.  Save.

Paste a button (or anything) into the blank form thats been waiting for you to come back, click the green 'Run' icon and, when the running form is displayed, can you interact with it ?


Followed these steps as well (Lazarus 1.9.0 r57663 FPC 3.0.4):


Carbon/32bit:
No dock icon and no menu. I cannot interact with the form or the button - the form/window never gets focus. However the system menu/icons can be clicked to close the window.


Cocoa/64bit:
No dock icon and again no menu. However I can interact with the form (form does get focus) and the button responds to clicking.

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: macOS 32-bit app warning
« Reply #38 on: April 21, 2018, 02:16:41 pm »
Hmm, well, thats interesting Hans, really does look like this is a problem.

" I have learned to not jump the gun right away and just be patient for a couple days..."

Yep, agree. But in this case, I have been back a month and a half and the problem is still there. So, I guess no one on the Dev team is testing against Mac ?

I don't see any bug reports that sound like this issue but I'm not good at searching the bug list. I suspect you need more permissions than I have to use any sort of useful filters.

Anyway, I think this does need to be reported, any objections ?


Related matters
Hans, I don't need to change compiler when changing between Carbon and Cocoa. To go from carbon to cocoa, I change Target CPU family from default to x86_64  and then click the link that says "Select another LCL widgetset ..." and from there, I choose 'cocoa'.

(removed ref to a bug that exists in 1.8 but is fixed in Trunk !)
« Last Edit: April 21, 2018, 02:28:07 pm by dbannon »
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: macOS 32-bit app warning
« Reply #39 on: April 21, 2018, 02:21:16 pm »
Hans, I don't need to change compiler when changing between Carbon and Cocoa. To go from carbon to cocoa, I change Target CPU family from default to x86_64  and then click the link that says "Select another LCL widgetset ..." and from there, I choose 'cocoa'.

Per Lazarus and all other IDEs: create two build modes, one named "Carbon", one named "Cocoa" and make any changes needed there, rather than fiddling with settings each time you need to switch between them. Obviously you could also have additional build modes if you need to change any settings for, say, a Windows build.

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: macOS 32-bit app warning
« Reply #40 on: April 21, 2018, 02:34:30 pm »
Good idea Phil. Think I should use the Build Mode more often...

Phil, do you think the bug about an app not being usable in the IDE on Mac should be reported ? Three of us have now seen it .....

I have not had a lot of success in reporting bugs so my confidence is not high  :-\

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

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: macOS 32-bit app warning
« Reply #41 on: April 21, 2018, 02:40:10 pm »
Good idea Phil. Think I should use the Build Mode more often...

Take a look at lainz's app here:

https://github.com/Arandusoft/fpcpaymowidget

The .lpi file has 9 build modes (Release-win32, Release-win64, etc.). That's the way it's done.

Phil, do you think the bug about an app not being usable in the IDE on Mac should be reported ? Three of us have now seen it .....

I have not had a lot of success in reporting bugs so my confidence is not high  :-\

Reporting doesn't necessarily mean it will be fixed, but NOT reporting it almost certainly means it WON'T be fixed.

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: macOS 32-bit app warning
« Reply #42 on: April 22, 2018, 03:00:48 am »
OK, I have logged this (no focus when run in IDE) issue #0033627

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
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 #43 on: April 22, 2018, 02:23:30 pm »
Thanks for the build mode tip - I never had a purpose for it (or so I though), I was wrong  :D  ....
Learn something new every day ...


Do any of the Mac users care to chime in on the question if a design on all platforms should look at least kind-a similar?
ie. design under Carbon, Windows or Linux and compile under Cocoa with a reasonable match position and size wise - with the exception of a few oddities like TButton limitations under Cocoa and the different tabs on a TPageControl.


Or is there an easier "trick" to compensate in code (although I doubt that would be a good programming practice especially when things change in the future)?

LazProgger

  • Full Member
  • ***
  • Posts: 103
Re: macOS 32-bit app warning
« Reply #44 on: April 22, 2018, 07:45:23 pm »
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.

 

TinyPortal © 2005-2018