CarbonLib

Mac OSX specific forum
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

Hi again Polo!
Unfortunately I don't think there's a lot of PB user on MacOSX (Mac are so expensive, I would love to have one ), but if you can call a function from another language it should be easy to call if with Purebasic
Yes it should be easy, but it depends if the language have 'variable types' that 'match' the Carbon Lib types ... That language I talk about have these 'types', but they not called the same as in C# or C++, so the best is to test.

And it should be easy is not the same as it works. And that is my Q. (See my other 'thread' Dylibs .....)

PS. Mac are cheep! You get an product that you know is working, and no virus problems .... :wink:

Regards,
SEO
Polo
Addict
Addict
Posts: 2422
Joined: Tue May 06, 2003 5:07 pm
Location: UK

Post by Polo »

Hmm, sorry to disagree, but Mac are NOT cheap, I could get a new (not good) PC for 300 euros, but not a Mac :)
For your problem, currently, those variable type are supported :
byte, word, long and float.
As long as the commands you wanna call don't need doubles or quads, Pb should do the job.
Of course, you can't be sure, maybe a Mac user is going to show up here ?
I wish I had a Mac :cry:
Fred
Administrator
Administrator
Posts: 16681
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

I put the exe (app bundle) here: www.purebasic.com/beta/mac/soimporter/test.tgz

The code look like this:

Code: Select all

If OpenWindow(0, 100, 100, 195, 260, #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget, "PureBasic Window")

err = ChangeWindowAttributes_(WindowID(0), 256, 0) 

Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow

EndIf
So the call definitely work (as expected as we used some in the IDE) but there is a wierd display bug, i will investigate once i will be on OS X again.
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

Nice to see that this is possible
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

Thanks Fred!

Yes there was an refresh problem, when I rezise the window.
But I think there should be an Refresh command somewhere.

Now my next problem is to find my wallet!

This could be very interesting, but thre is a lot of work and learning I have to do. And I should share my experiences with the PB Mac users.

Regards,
SEO

------------------------------------
PS. To the readers: That was an Example how to create an Metal Window by using Carbon call. http://www.xhtmlsoft.com/pb/images/purebasicmetalw.jpg
------------------------------------
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

shell out now! when the monday arrives on the mac, you'll be blown away and hate yourself that you still have to purchase pb :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

It is DONE :!:

But I still have problems wit the dylibs calls ...
Please check the Mac Dynamic Library thread..

Thx,
SEO
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post by Dare2 »

Welcome on board. :)
@}--`--,-- A rose by any other name ..
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

Thanks to Dare2!

Carbonx version 0.0.1 is available for download.
Sounds nice... but this is only an test and try.

There is only a few functions that works and some more that not works :D

Carbonx is an Mac Carbon Library (or should be), as an workaround for 'missing' features in the Mac version of PB.

It would take some time, before we could call it an Library, this because I am an newbie on PB and absolute not an expert on carbon, but with some work, work and work....

So PB Mac users, please help me to test it out ....
1 - Do the idea works... could you 'install' the Library?
2 - Do the 'functions' that should work also work for you?
3 - Do you wan't that I should try to fix more functions?
4 - Any problems to download the file (Mac zip)?

Download:
http://www.xhtmlsoft.com/pb/downloads/
-------------------------------------------------------------

If you have any 'functions' you would add to the Library, please give me the code so i could add it! The carbonx Library is free and should be free to use!!

Looking forward to hearing from you, but hurry, version 0.0.2 is available soon...

Regards,
SEO
Fred
Administrator
Administrator
Posts: 16681
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Nice ! I have alkready done a few Carbon functions, so if you want i will commit them on CVS so you can complete them (instead of creating new pbl file). So everybody will benefit of it :wink:.

BTW, I just fixed the redraw bug with metal window. Just get www.purebasic.com/beta/mac/Window and install it in the purebasic/purelibraries/ drawer (overwrite the old one).
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

I create pbl files every minute!
Njema Problema....

I have some question later... about convert data types, but I try here first.

It is Okey to use #C as 'namespace' for carbon constants??

Sorry, I do not understand you about your Carbon stuff?
All PB Users would get my works for free (CarbonLib)!!
Great (metal Window) Should check it out...

I just check Toolbar stuff, PB have the Toolbar 'Hide' as default, you have to click on the Toolbar widget... Could it 'Show' be default?


Regards,
SEO
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

Metal Window Great!
Is it Composite now or is the window created as Non Composite...

I have fixed some more Windows stuff, and next 'public' release would be available later today...

Regards,
SEO
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

I thnik Fred means that he already works on a PBL File discribing carbon functions and he offers it to download for you to help him completing it wich will help all Purebasic Mac users too because he than can add it to the default package for mac.
Nik
Addict
Addict
Posts: 1017
Joined: Fri May 13, 2005 11:45 pm
Location: Germany
Contact:

Post by Nik »

So lets see what the future will give to us
SEO
Enthusiast
Enthusiast
Posts: 178
Joined: Fri Dec 09, 2005 11:42 pm
Location: Sweden
Contact:

Post by SEO »

OK I understand...

But then later, I have much to learn, and there should be no problems, If I have his 'public' versions, the I see that the function is already in use.

But do you see any problems to download my files and add to PB?
This was only an first test... You see now we have fixed an metal window to the PB users..

I also think that many of the PB Mac users, have something to learn of my examples, I hope. There is a lot of work to get an 'Mac application' .. And I am willing to share my stuff... And perhaps I get some help from the 'older' PB users..

Regards,
SEO
Post Reply