Recent

Author Topic: Hints not appearing on app on Apple Mac [SOLVED]  (Read 5398 times)

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Hints not appearing on app on Apple Mac [SOLVED]
« on: July 15, 2017, 02:54:09 pm »
Lazarus 1.8.0 RC3
FPC 3.0.2
macOS 10.12.5 Sierra

Hello, I've just added a TToolbar with a couple of buttons to my application. These buttons have Hint properties associated with them. However, I am not seeing any hints appear. Moreover, I have added an Application.OnShowHint event handler and stuck a breakpoint in there, and the breakpoint is not being hit. Can anyone confirm that the LCL hint system does indeed work under Lazarus on the Apple Mac?

I assume it must work since the Lazarus IDE itself displays hints quite happily. What am I doing wrong?
« Last Edit: July 16, 2017, 12:10:08 pm by carl_caulkett »
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

balazsszekely

  • Guest
Re: Hints not appearing on app on Apple Mac
« Reply #1 on: July 15, 2017, 09:37:16 pm »
Did you set ShowHint to true? It works fine for me on macOS Sierra, Lazarus Trunk, FPC 3.0.2


carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Hints not appearing on app on Apple Mac
« Reply #2 on: July 15, 2017, 09:49:50 pm »
Yep. ShowHint is set to True on the buttons themselves and all parent controls right up to the form.

I'm going to create a small test project...
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

balazsszekely

  • Guest
Re: Hints not appearing on app on Apple Mac
« Reply #3 on: July 15, 2017, 10:05:00 pm »
@carl_caulkett
Please take a look: https://youtu.be/FsRkS8dlpDo
Maybe it was fixed recently in Lazarus trunk.

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Hints not appearing on app on Apple Mac
« Reply #4 on: July 15, 2017, 10:11:49 pm »
Well, I've just made a small test project of equal complexity to that video. No Hints on mine. I've got the Trunk downloaded - I'll give it a try there...
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Hints not appearing on app on Apple Mac
« Reply #5 on: July 15, 2017, 10:26:20 pm »
Hey GetMem, any chance of uploading a small project that definitely works on your system? TIA.
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Hints not appearing on app on Apple Mac
« Reply #6 on: July 15, 2017, 10:54:23 pm »
I'm having issues starting the trunk version of Lazarus. It keeps complaining about the config path...
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Hints not appearing on app on Apple Mac
« Reply #7 on: July 15, 2017, 11:11:21 pm »
I'm having issues starting the trunk version of Lazarus. It keeps complaining about the config path...

See point 3:

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


carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Hints not appearing on app on Apple Mac
« Reply #8 on: July 16, 2017, 01:41:37 am »
Thanks, Phil. OK, I have rebuilt the trunk with cocoa to get a Cocoa Lazarus 1.9. I then created a shell script with:
Code: Pascal  [Select][+][-]
  1. #!/bin/sh
  2. open lazarus.app --args "--pcp=~/.laz-cocoa"
  3.  
That launches the cocoa Lazarus successfully.
I then downloaded the truck source again to another folder ~/code/fpc/laz-carbon and rebuilt the source there with make LCL_PLATFORM=cocoa CPU_TARGET=x86_64. Then I created another shell script with:
Code: Pascal  [Select][+][-]
  1. #!/bin/sh
  2. open lazarus.app --args "--pcp=~/.laz-carbon"
  3.  
When I run this shell script it fails to open Lazarus and gives the error:
The application cannot be opened because its executable is missing.
A quick search on google led me to try:
chmod +x lazarus.app/Contents/MacOS/*
but this did not help.

I can only assume I did something wrong when building the Carbon version of the Lazarus trunk, but it all seemed to run ok, so I'm really puzzled at the moment. Can anyone help?

"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Hints not appearing on app on Apple Mac
« Reply #9 on: July 16, 2017, 01:47:21 am »
I'm re-trying the make command with
make clean all on the basis that the default widget set should be carbon. We'll see in 5 minutes!
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Hints not appearing on app on Apple Mac
« Reply #10 on: July 16, 2017, 02:10:00 am »
That worked. So I was able to test my minimal TestHints app in both Cocoa and Carbon versions of Lazarus 1.9. The results were that the app wouldn't run under Cocoa, and under Carbon, I still couldn't get control hints to appear. So the net result is that I've learnt a lot about configuring Lazarus, so that's good. In terms of solving my missing hints problem, I'm no further forward. So it goes, as Kurt would say!
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

balazsszekely

  • Guest
Re: Hints not appearing on app on Apple Mac
« Reply #11 on: July 16, 2017, 06:28:21 am »
@carl_caulkett
Quote
Hey GetMem, any chance of uploading a small project that definitely works on your system?
Attached test project.

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Hints not appearing on app on Apple Mac [SOLUTION HERE!]
« Reply #12 on: July 16, 2017, 12:08:32 pm »
Thanks!

The problem was that the toolbar buttons in my project had the property ParentShowHint := True;. This had the result that although the buttons' ShowHint properties were showing as True in the object inspector, the property was not being saved in the associated lfm file. I set the ParentShowHint := False; for all buttons, and lo and behold, the ShowHint properties appeared in my lfm files and, of course, they appear when the app is run.

This seems to me to be something slightly screwy in Lazarus' streaming mechanism - essentially the system is not honouring the effects of one particular property - the ShowHint property - but is instead relying on the state of another property - the ParentShowHint property - to determine if the ShowHint property actually works, despite the object inspector showing True for ShowHint at all times.
« Last Edit: July 16, 2017, 12:10:35 pm by carl_caulkett »
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

 

TinyPortal © 2005-2018