* * *

Author Topic: Lazarus with carbon / Qt  (Read 3852 times)

ac

  • New member
  • *
  • Posts: 14
Lazarus with carbon / Qt
« on: October 11, 2006, 12:24:31 pm »
Hi,

I'm trying to programm interfaces with IDE Lazarus and carbon as LCL widget type on a mac os 10.3.
There are no problems during compiling and I'm able to launch the application, but then nothing works.
I can't klick a button and even not move the window. I get following output in the bash shell:

EventClass: "appl" Eventkind: ""
EventClass: "eppc" Eventkind: ""
EventClass: "cgs" Eventkind: ""
EventClass: "mous" Eventkind: ""
...

Is there something I must change in the freepascal code to manage the event handling?
And if this is the case, what ?

I hope someone could help me.
Thanks !!!!!!!!!
(sorry for my bad english ;-) )

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2454
RE: Lazarus with carbon LCL
« Reply #1 on: October 11, 2006, 05:16:15 pm »
The carbon interface is in an early alpha stage. Not read for app other than a hello world
//--
{$I stdsig.inc}
//-Patches are always welcome at patch (at) dommelstein.net (please put the word "patch" in the subject)
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

ac

  • New member
  • *
  • Posts: 14
Lazarus with carbon / Qt
« Reply #2 on: October 11, 2006, 06:06:14 pm »
Yeah, you are right, I know.
I tried only a hello world application. just a simple button that changes caption  when klicking. trying this I got the error.

I read that this should work:
http://wiki.lazarus.freepascal.org/Carbon_interface_internals
"What is already working?
 - Creating and clicking on a TButton "

but it doesn't.
I found a sentence that made me afraid at
http://wiki.lazarus.freepascal.org/Carbon_Interface
The last sentence unde 4.1:
"You should now be able to compile the project without errors. It will create an executable project1, but you can not focus it. That's because Mac OS X expects some hidden resource files."

What does this exactly mean?
Is it possible to create a button with carbon, but not klicking on it because I can't focus the form?

help ...  :cry:

Phil

  • Hero Member
  • *****
  • Posts: 1338
Lazarus with carbon / Qt
« Reply #3 on: October 11, 2006, 06:21:40 pm »
Quote from: "ac"

The last sentence unde 4.1:
"You should now be able to compile the project without errors. It will create an executable project1, but you can not focus it. That's because Mac OS X expects some hidden resource files."

What does this exactly mean?
Is it possible to create a button with carbon, but not klicking on it because I can't focus the form?

help ...  :cry:


Sounds like you haven't found much of the OS X wiki documentation:

http://wiki.lazarus.freepascal.org/index.php/OS_X_Programming_Tips

Carbon isn't very far along. If you want to work with a widgetset that has a more Mac native feel than GTK, try Qt. A great deal of progress has been made with the Qt widgetset for Lazarus lately. Be sure you're working with the latest Lazarus snapshot or SVN source as changes are currently being made almost daily to Qt.

http://wiki.lazarus.freepascal.org/Qt_Interface_Mac

ac

  • New member
  • *
  • Posts: 14
Lazarus with carbon / Qt
« Reply #4 on: October 12, 2006, 10:02:33 am »
hmm I  tried Qt before in version 4.1.1 and 4.2 but nothing worked.

I used this guide to install Qt: http://wiki.lazarus.freepascal.org/Qt_Interface_Mac

I got in trouble with section 7 (compiling the Lazarus LCL for the QT widgetset). While rebuilding Lazarus there is an error:

/Users/<username>/lazarus/lcl/interfaces/qt/qt4.pas(5971,1) Error: Identifier not found "SetExceptionMask"
/Users/<username>/lazarus/lcl/interfaces/qt/qt4.pas(5971,19) Error: Identifier not found "exDenormalized"
/Users/<username>/lazarus/lcl/interfaces/qt/qt4.pas(5971,34) Error: Identifier not found "exInvalidOp"
/Users/<username>/lazarus/lcl/interfaces/qt/qt4.pas(5971,46) Error: Identifier not found "exOverflow"
/Users/<username>/lazarus/lcl/interfaces/qt/qt4.pas(5971,57) Error: Identifier not found "exPrecision"
/Users/<username>/lazarus/lcl/interfaces/qt/qt4.pas(5971,69) Error: Identifier not found "exUnderflow"
/Users/<username>/lazarus/lcl/interfaces/qt/qt4.pas(5971,81) Error: Identifier not found "exZeroDivide"
/Users/<username>/lazarus/lcl/interfaces/qt/qt4.pas(5971,95) Error: Illegal expression
/Users/<username>/lazarus/lcl/interfaces/qt/qt4.pas(5975) Fatal: There were 8 errors compiling module, stopping

In the Lazarus Source Editor window the qt4.pas is opened and one of the last lines is marked:

SetExceptionMask([exDenormalized,exInvalidOp,exOverflow,exPrecision,exUnderflow,exZeroDivide]);

I found no help so, I tried carbon. May be here in this forum is somebody could help me.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3165
Lazarus with carbon / Qt
« Reply #5 on: October 12, 2006, 01:12:14 pm »
Currently, the qt4.pas files is platform specific, and the default one shiped with Lazarus only works for Linux-x86

You can download a qt4.pas file for Mac here:

http://users.pandora.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html

This problem will be solved on the near future, when we start shipping platform-independent qt4.pas files.

ac

  • New member
  • *
  • Posts: 14
Lazarus with carbon / Qt
« Reply #6 on: October 12, 2006, 01:30:43 pm »
hmm .....

I did this. I downloaded the mac_qt4pas-1.15 and executed the scipts:
compile_lib_mac.sh and create_framework_mac.sh

Further I copied the qt4.pas to /Users/<username>/lazarus/lcl/interfaces/qt


But I still got these 8 errors while rebuilding lazarus

Phil

  • Hero Member
  • *****
  • Posts: 1338
Lazarus with carbon / Qt
« Reply #7 on: October 12, 2006, 03:27:54 pm »
Quote from: "sekel"
Currently, the qt4.pas files is platform specific, and the default one shiped with Lazarus only works for Linux-x86

You can download a qt4.pas file for Mac here:

http://users.pandora.be/Jan.Van.hijfte/qtforfpc/fpcqt4.html

This problem will be solved on the near future, when we start shipping platform-independent qt4.pas files.


I've been using the Qt4.pas that ships with Lazarus. In any case, this SetExceptionMask call appears in all versions of Qt4.pas.

SetExceptionMask is in the Math unit. Is it possible that you're using an old version of Free Pascal?

Also, what type of Mac are you using? Version of OS X, etc.

Thanks.

ac

  • New member
  • *
  • Posts: 14
Lazarus with carbon / Qt
« Reply #8 on: October 12, 2006, 04:27:47 pm »
WOW ! phil you're right ! it works, everything works.
Phil, I'm fucking loving you. great. thanks !!!

what a wonderful day! I'll mark it red in my calender !!
Thanks to all of you ! :D  :!:  :!:  :!:

Phil

  • Hero Member
  • *****
  • Posts: 1338
Lazarus with carbon / Qt
« Reply #9 on: October 12, 2006, 07:22:36 pm »
Quote from: "ac"
WOW ! phil you're right ! it works, everything works.


Let us know if you have any other problems with Qt on OS X. Seeing things from a newcomer's eyes is always a good way of improving the instructions.

ac

  • New member
  • *
  • Posts: 14
Lazarus with carbon / Qt
« Reply #10 on: October 13, 2006, 01:59:18 pm »
Hi there,

yesterday I installed installed fpc2.0.4 to get Qt runinng. It works and it is great. Thanks again !

But now I'm again in trouble:
Since I installed the newer version of fpc I couldn't execute "make" in the shell:
Makefile28: ***You need the GNU utils package to use this makefile

I heard that these GUU utils are involved in fpc and xcode. I installed both, but now make doesn't work.

I only found help for Windows users getting this error, but not for Mac.


Phil asked me for information about my system. so here you are (maybe it'll help):
Mac OS X 10.3.9
CPU-type: PowerPC G4

I'm glad that here are so many good supporters in this forum !!


EDIT: Sorry, I got it. I'm just to stupid the confige the PATH ... Need no help more, but thanks to people who tried to find a answer

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads