Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Notifications
Clear all

[Solved] Lazarus Pascal - macOS - Fix Lazarus pascal Error: Identifier not found "CocoaPromptUser"

1 Posts
1 Users
0 Reactions
20 Views
 Hans
(@hans)
Famed Member Admin
Joined: 13 years ago
Posts: 3182
Topic starter   [#1592]

For some reason things have changed in the unit CocoaInt, which results in an error when calling "CocoaPromptUser".
The error message: Identifier not found "CocoaPromptUser"

The fix:

In the unit CocoaInt, the prompt is now part of the TCocoaWidgetSet class (linked to the global variable CocoaWidgetSet).
Additional thing to know: the last 2 parameters one used to use in CocoaPromptUser are not longer needed.

Old code example

ButtonPressed := CocoaPromptUser(DialogCaption, DialogMessage ,DialogTypeID, ButtonArrayPtr, ButtonCount, DefaultIndex, 0, NSParentWindow, true);

The last 2 parameters (NSParentWindow, true) are no longer needed, and the function is now called through CocoaWidgetSet.PromptUser.

The new code:

ButtonPressed := CocoaWidgetSet.PromptUser(DialogCaption, DialogMessage ,DialogTypeID, ButtonArrayPtr, ButtonCount, DefaultIndex, 0);

 

Hope this is helpful to someone 😊 



   
ReplyQuote
Share: