Lazarus

Installation => macOS / Mac OS X => Topic started by: Phil on April 07, 2007, 07:18:08 pm

Title: Carbon widgetset news
Post by: Phil 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.
Title: carbon widgetset news
Post by: geoffrey 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?
Title: Re: carbon widgetset news
Post by: Phil 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.
Title: Carbon widgetset news
Post by: gareth 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
Title: Re: carbon widgetset news
Post by: geoffrey 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
Title: Carbon widgetset news
Post by: geoffrey 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!
Title: Re: carbon widgetset news
Post by: Phil 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.
Title: Re: carbon widgetset news
Post by: geoffrey 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...
Title: Re: carbon widgetset news
Post by: geoffrey 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
Title: RE: Re: carbon widgetset news
Post by: Tombo 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.
Title: Re: RE: Re: carbon widgetset news
Post by: geoffrey 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?
Title: Re: RE: Re: carbon widgetset news
Post by: Phil 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).
Title: Re: RE: Re: carbon widgetset news
Post by: geoffrey 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
Title: RE: Re: RE: Re: carbon widgetset news
Post by: Tombo on April 20, 2007, 05:20:37 pm
Please download snapshot 20070420 - there it should be fixed.
Title: Re: RE: Re: RE: Re: carbon widgetset news
Post by: geoffrey 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.....
Title: Re: RE: Re: RE: Re: carbon widgetset news
Post by: abb on April 25, 2007, 06:54:17 pm
Quote from: "geoffrey"
success at last! now to make it do something useful.....

I'd like to ask you, whether you have any problems with the debugger, when you trace your Carbo App on your Intel Mac? As for me, I have... breakpoints do not working. So, debugger is just useless... :(

Thanks.
Title: RE: Re: RE: Re: RE: Re: carbon widgetset news
Post by: Marc on April 26, 2007, 11:45:11 am
ow... that is sill an issue I'm looking at. Somehow the debugger doesn't work for intel macs (i only have a ppc)
Title: RE: Re: RE: Re: RE: Re: carbon widgetset news
Post by: abb on April 26, 2007, 06:43:45 pm
Please look at this X11 log:

[DBGTGT] TCarbonWindow.CreateWidget succeeds
[DBGTGT] TCarbonWindow.RegisterEvents TCarbonWindow Form1: TForm1
[DBGTGT] CarbonCommon_BoundsChanged Form1:TForm1
[DBGTGT] CarbonCommon_BoundsChanged Form1:TForm1
[DBGTGT] TCarbonControl.RegisterEvents TCarbonButton Button1: TButton
[DBGTGT] TCarbonControl.RegisterEvents TCarbonButton Button2: TButton
[DBGTGT] TCarbonControl.RegisterEvents TCarbonStaticText StaticText1: TStaticText
[DBGTGT] TCarbonControl.RegisterEvents TCarbonStaticText StaticText2: TStaticText
[DBGTGT] TCarbonControl.RegisterEvents TCarbonStaticText StaticText3: TStaticText
[DBGTGT] TCarbonWidgetSet.SetScrollInfo Error - Widget TCarbonWindow is not TCarbonCustomControl!
[DBGTGT] TCarbonWidgetSet.SetScrollInfo Error - Widget TCarbonWindow is not TCarbonCustomControl!
[DBGTGT] CarbonCommon_BoundsChanged Form1:TForm1

This is the end of a very long log, which appears at the application startup in the IDE. What does it mean that:
 
"Widget TCarbonWindow is not TCarbonCustomControl!"?

Is it a bug or a feature yet missing?

Thanks.

P.S. Use 0425 SVN.
Title: RE: Re: RE: Re: RE: Re: carbon widgetset news
Post by: Tombo on April 26, 2007, 08:25:20 pm
It's a missing feature.
Carbon widgetset has slightly different hierarchy than LCL. The TCarbonWindow class is not descendant of TCarbonControl nor TCarbonScrollingWinControl. To assure scrolling for TForm, we need to insert scroll box into it. That's TODO.
I agree, that the message is quite puzzling and not very precise.
Title: Carbon widgetset bounties
Post by: crorden on April 30, 2007, 10:52:17 pm
Tombo is doing amazing work. It is nice to see the TImage component working so well. I have created a couple of bounties to encourage someone to develop the components that I use regularly:
  http://wiki.lazarus.freepascal.org/Bounties
Beyond the money, I would be really grateful for someone to port these components to the Carbon interface.
Title: Re: Carbon widgetset bounties
Post by: Phil on May 01, 2007, 04:48:24 pm
Quote from: "crorden"
I have created a couple of bounties to encourage someone to develop the components that I use regularly:
  http://wiki.lazarus.freepascal.org/Bounties
Beyond the money, I would be really grateful for someone to port these components to the Carbon interface.


Have you looked at the Orpheus TOvcSpinner control? The last time I checked it wasn't yet working with the Carbon widgetset, but you could try it out with Gtk to see how it works and whether you like it. I don't know if this control would be of any interest to you, but it does have one big advantage over TSpinEdit: Since Orpheus is also available for Delphi this adds a spin control to Delphi, which doesn't have one. This might allow you to compile your program with Delphi too.

http://web.fastermac.net/~MacPgmr/OrphPort/OrphStatus.html
Title: Carbon widgetset news
Post by: crorden on May 02, 2007, 04:06:46 pm
Phil-

The windows version of mricron I distribute is compiled with Delphi (allows shared memory, drag and drop, etc), and I use the RX component library's RXspinEdit for floating point values. However, I think it would be great to have a Carbon version of TFloatSpinEdit, as this would allow people to compile the code right out of the box. At the moment the same Lazarus code compiles on Windows, Linux, MacOSXppc (GTK) and MacOSXintel (GTK).
TinyPortal © 2005-2018