Recent

Author Topic: Carbon widgetset news  (Read 19663 times)

Phil

  • Hero Member
  • *****
  • Posts: 2737
Carbon widgetset news
« on: April 07, 2007, 07:18:08 pm »
Tom G. continues to make great progress in the development of the native Carbon widgetset for Lazarus and OS X. If you haven't tried a recent snapshot of Lazarus, try out today's snapshot. Here's the current status of Carbon controls:

http://wiki.lazarus.freepascal.org/Roadmap#Widgetset_dependent_components

The compiled Carbon units are included in the snapshot so you don't have to recompile the LCL.

To compile your own app with Carbon, these are the only differences from compiling with the GTK widgetset:

(1) Select Carbon in Project | Compiler Options on the Paths tab under LCL Widget Type.

(2) On the Linking tab, select Pass Options To The Linker and enter this in  the box:

  -framework carbon

(3) To run your compiled executable, be sure to create an app bundle for it. If you don't know how to create this, a script that does it for you is here:

  http://web.fastermac.net/~MacPgmr/Lazarus/

See the ReadMe.txt file for information on how to use the script.

geoffrey

  • New member
  • *
  • Posts: 9
carbon widgetset news
« Reply #1 on: April 14, 2007, 10:56:11 am »
Having many Delphi sources it would be useful to transfer to the Intel Mac, I just tried this; I have no experience outside Windows programming.

I downloaded and installed the snapshot for 20070413 for FPC and Lazarus OSX intel and set the options per Phil's mail.

I get a compilation failure 'project1.lpr(1,1) Fatal: Can't find unit CarbonDef'

I found what I think is the relevant unit 'CarbonDef.ppu' and tried various path settings in the compiler options but still get the error. Any ideas?

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: carbon widgetset news
« Reply #2 on: April 14, 2007, 04:39:36 pm »
Quote from: "geoffrey"
I get a compilation failure 'project1.lpr(1,1) Fatal: Can't find unit CarbonDef'


This appears to be a Free Pascal bug. For now this is what I did to work around it:

- Edit file carbonutils.pas and carbonproc.pp in /lazarus/lcl/interfaces/carbon and comment out all the inline directives. For example, change:

  function AsControlRef(Handle: HWND): ControlRef; inline;

to this:

  function AsControlRef(Handle: HWND): ControlRef; //inline;

Now rebuild the Carbon widgetset:

- Tools | Configure
- Set everything to None except Build LCL.
- Set LCL Interface to Carbon.
- Click Build.

After it's done rebuilding the widgetset, try compiling your project and see if that doesn't fix it.

gareth

  • Newbie
  • Posts: 1
Carbon widgetset news
« Reply #3 on: April 16, 2007, 02:50:33 pm »
The solution I found to this error was to add the path to the carbon interfaces in the 'other unit files' of the compiler options. I also had to add the option -dCARBON1 on 'other' tab under 'custom options'.

YMMV.

Regards
Gareth

geoffrey

  • New member
  • *
  • Posts: 9
Re: carbon widgetset news
« Reply #4 on: April 16, 2007, 04:45:57 pm »
Quote from: "Phil"

This appears to be a Free Pascal bug. For now this is what I did to work around it:

- Edit file carbonutils.pas and carbonproc.pp in /lazarus/lcl/interfaces/carbon and comment out all the inline directives. For example, change:

  function AsControlRef(Handle: HWND): ControlRef; inline;

to this:

  function AsControlRef(Handle: HWND): ControlRef; //inline;

Now rebuild the Carbon widgetset:

- Tools | Configure
- Set everything to None except Build LCL.
- Set LCL Interface to Carbon.
- Click Build.

After it's done rebuilding the widgetset, try compiling your project and see if that doesn't fix it.


I have now tried this, but the error message is unchanged

geoffrey

  • New member
  • *
  • Posts: 9
Carbon widgetset news
« Reply #5 on: April 16, 2007, 04:49:46 pm »
Quote from: "gareth"
The solution I found to this error was to add the path to the carbon interfaces in the 'other unit files' of the compiler options. I also had to add the option -dCARBON1 on 'other' tab under 'custom options'.

YMMV.

Regards
Gareth


I had already tried adding the path to the carbon interfaces.

adding the -dCARBON1 did not help either!

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: carbon widgetset news
« Reply #6 on: April 16, 2007, 10:50:23 pm »
Quote from: "geoffrey"
I have now tried this, but the error message is unchanged


Sorry I don't have an Intel Mac to test the Carbon widgetset. I have notified Tom G. to see if he has any ideas.

Remember that the Carbon widgetset is in heavy development so this sort of thing is to be expected.

geoffrey

  • New member
  • *
  • Posts: 9
Re: carbon widgetset news
« Reply #7 on: April 17, 2007, 11:18:07 am »
Quote from: "Phil"
Quote from: "geoffrey"
I have now tried this, but the error message is unchanged


Sorry I don't have an Intel Mac to test the Carbon widgetset. I have notified Tom G. to see if he has any ideas.

Remember that the Carbon widgetset is in heavy development so this sort of thing is to be expected.


thanks for trying. I am not giving up! I think the progress of the Lazarus project is extraordinary. The fact is, if somebody has already got this running on an Intel Mac, then I must have done something wrong. Will try from scratch on Wife's Imac...

geoffrey

  • New member
  • *
  • Posts: 9
Re: carbon widgetset news
« Reply #8 on: April 17, 2007, 02:00:12 pm »
Quote from: "Phil"


Sorry I don't have an Intel Mac to test the Carbon widgetset. I have notified Tom G. to see if he has any ideas.

Remember that the Carbon widgetset is in heavy development so this sort of thing is to be expected.


I have realised there is more info in the X window, I don't know whether this helps:-

Compiling project1.lpr
PPU Loading /usr/local/share/lazarus/lcl/units/i386-darwin/carbon/CarbonDef.ppu
PPU Source: CarbonDef.pp not found
PPU Source: carbondebug.inc not found
Recompiling CarbonDef, checksum changed for CarbonUtils
PPU Loading /usr/local/share/lazarus/lcl/units/i386-darwin/carbon/CarbonDef.ppu
Fatal: Can't find unit CarbonDef
QuickFixUnitNotFoundPosition failed due to syntax errors

Tombo

  • New Member
  • *
  • Posts: 21
RE: Re: carbon widgetset news
« Reply #9 on: April 17, 2007, 03:29:24 pm »
I do apoligize.
When improving Carbon widgetset, I ran into some problems with inline functions and circles in unit referencing.
I think, now I have solved it.
Please update Lazarus from svn or use daily snapshot 20070418.

geoffrey

  • New member
  • *
  • Posts: 9
Re: RE: Re: carbon widgetset news
« Reply #10 on: April 17, 2007, 03:40:15 pm »
Quote from: "Tombo"
I do apoligize.
When improving Carbon widgetset, I ran into some problems with inline functions and circles in unit referencing.
I think, now I have solved it.
Please update Lazarus from svn or use daily snapshot 20070418.


no apology required...

Do you actually mean 20070418, as at this moment the server only shows 20070417?

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: RE: Re: carbon widgetset news
« Reply #11 on: April 17, 2007, 03:46:28 pm »
Quote from: "geoffrey"
Quote from: "Tombo"
I do apoligize.
When improving Carbon widgetset, I ran into some problems with inline functions and circles in unit referencing.
I think, now I have solved it.
Please update Lazarus from svn or use daily snapshot 20070418.


no apology required...

Do you actually mean 20070418, as at this moment the server only shows 20070417?


The updated source will be in tomorrow's snapshot (20070418).

geoffrey

  • New member
  • *
  • Posts: 9
Re: RE: Re: carbon widgetset news
« Reply #12 on: April 20, 2007, 09:32:38 am »
Quote from: "Tombo"
I do apoligize.
When improving Carbon widgetset, I ran into some problems with inline functions and circles in unit referencing.
I think, now I have solved it.
Please update Lazarus from svn or use daily snapshot 20070418.


using 20070419 I get:-

Compiling project1.lpr
PPU Loading /usr/local/share/lazarus/lcl/units/i386-darwin/carbon/CarbonCanvas.ppu
PPU Source: CarbonCanvas.pp not found
PPU Source: carbondebug.inc not found
Recompiling CarbonCanvas, checksum changed for CarbonDef
PPU Loading /usr/local/share/lazarus/lcl/units/i386-darwin/carbon/CarbonCanvas.ppu
Fatal: Can't find unit CarbonCanvas

Tombo

  • New Member
  • *
  • Posts: 21
RE: Re: RE: Re: carbon widgetset news
« Reply #13 on: April 20, 2007, 05:20:37 pm »
Please download snapshot 20070420 - there it should be fixed.

geoffrey

  • New member
  • *
  • Posts: 9
Re: RE: Re: RE: Re: carbon widgetset news
« Reply #14 on: April 20, 2007, 06:25:49 pm »
Quote from: "Tombo"
Please download snapshot 20070420 - there it should be fixed.


success at last!

Thank you for your help.

now to make it do something useful.....

 

TinyPortal © 2005-2018