Forum > macOS / Mac OS X

Using NSToolbar in Lazarus

<< < (2/3) > >>

CCRDude:
Illegal type conversion of "Pobjc_object"

The old version still seems to be shipped as well.

Anyway, I just pushed a new commit where the package compiles for me (macOS Ventura, Lazarus trunk).

Hansaplast:
Seems I have to wait a minute or so, since Github is still showing me the old 377 line version of that file. (NSGraphicsContext.inc)
I will try again tomorrow - looking forward to see this work 😁

CCRDude:
The Lazarus GitHub still has this file, no idea why it's included in Lazarus if it's old and a new one exists?
My message was referring to my GitLab repository, where I updated the package file.

It seems both versions exist:
fpcsrc/packages/cocoaint/src/appkit/NSGraphicsContext.inc (new)
lazarus/lcl/interfaces/carbon/pascocoa/appkit/NSGraphicsContext.inc (old)

Since the second speaks about the Carbon interface, and my project settings refer to the Cocoa interface, how about this change to your project:

Project -> Project Options... -> Compiler Options -> Additions and Overrides -> Add -> IDE Macro: LCLWidgetType:=cocoa

Have you tried the example project?

I posted in the existing thread about this issue...

Hansaplast:

Apologies for the delayed response.


I just tried the latest version you have on Gitlab, and have tried the included example.
I'm no longer getting the compiler error, but the example unfortunately it keeps crashing. Trying to debug didn't show my anything helpful either. Adding the Cocoa widgetset and adding -WM11.0 (which I use for most of my projects now anyway) manually didn't make a difference.
For reference: Lazarus 3.99 (rev main_3_99-1510-g805f05ea99) FPC 3.3.1 aarch64-darwin-cocoa

CCRDude:
To debug, you probably would have to remove the package from the example code, and add the source files to the project, or at least the source folder to it settings.

Do you mean by "keeps crashing" that the same error in NSGraphicsContext.inc is showing, or something else?

I'm just thinking... I'm not sure if I've embedded the app bundle in the repository, but the example also loads graphical resources there. Will have to check that.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version