Page 2 of 3

Re: Development for Cocoa is underway!

Posted: Thu May 31, 2012 4:46 pm
by TI-994A
void wrote:Seeing things like that is very horribly distressing, and pretty much exactly why I tend to avoid most programming languages.
void wrote:I agree with your first sentence in principle but in practice I suffer from severe cognitive barriers regarding syntax-heavy languages.
Well said. Regardless of how many different languages we know, we'll always have a well-versed favourite; and mine is PureBasic.

Re: Development for Cocoa is underway!

Posted: Thu Jul 05, 2012 7:26 pm
by spacebuddy
Any news on the status of the Coco version of PB? :D

Re: Development for Cocoa is underway!

Posted: Thu Jul 05, 2012 10:04 pm
by J. Baker
spacebuddy wrote:Any news on the status of the Coco version of PB? :D
Talked to Fred recently about another topic but he did give an update on its status and said, "...which is growing nicely btw". So it sounds like all is going well. ;)

Re: Development for Cocoa is underway!

Posted: Fri Jul 06, 2012 10:47 am
by Polo
J. Baker wrote:
spacebuddy wrote:Any news on the status of the Coco version of PB? :D
Talked to Fred recently about another topic but he did give an update on its status and said, "...which is growing nicely btw". So it sounds like all is going well. ;)
That's good news! :)

Re: Development for Cocoa is underway!

Posted: Mon Jul 23, 2012 9:21 pm
by Polo
Any news on the current state of the Cocoa update? :)
I must say I'm itching to test it! :)

Re: Development for Cocoa is underway!

Posted: Tue Jul 24, 2012 2:51 pm
by Fred
Almost ready :). Here is a screenshot of the Cocoa'ified IDE:

http://www.purebasic.com/Cocoa.png

Re: Development for Cocoa is underway!

Posted: Tue Jul 24, 2012 3:10 pm
by srod
Wow, how many Basic compilers 'out there' support OSX Cocoa?

This is fantastic. I cannot even begin to imagine how much work this has been for you and Timo Fred. Scares the life out of me even thinking about it!

btw, will we be able to call the Cocoa API's directly like we can the Win API or will we need to create appropriate c wrappers around objective C calls etc? Just wondering. :)

Re: Development for Cocoa is underway!

Posted: Tue Jul 24, 2012 3:15 pm
by Polo
Brilliant Fred, thanks!!

Did you think about adding a flag so we can use Lion's fullscreen windows? I love using it on Itunes, Chrome and such and I'd love my app to be able to do that as well! :)

Re: Development for Cocoa is underway!

Posted: Tue Jul 24, 2012 3:18 pm
by Fred
That's really a lot of work, but it was fun to do (except some quirks here and here).

It's not possible to call directly objective C call as WinAPI, as it's not really calls, but messages. And the syntax doesn't fit regular API calls. The best for now is to do tiny C wrappers and use ImportC , that's how I did for the IDE and it works well. That said, wilbert wrote an objectiveC wrapper for PB to do some call: http://www.purebasic.fr/english/viewtop ... bjective+C

About the flag, it's not planned for now, but it should be doable via a C call

Re: Development for Cocoa is underway!

Posted: Tue Jul 24, 2012 3:30 pm
by Polo
Fred wrote:About the flag, it's not planned for now, but it should be doable via a C call
Oh ok, I'll do that then when a beta is released :)

Re: Development for Cocoa is underway!

Posted: Tue Jul 24, 2012 3:32 pm
by Polo
As you probably have Xcode opened right now ( :twisted: ) would it be possible to have OSX standard status bar (like iTunes for instance, ie darker than the current PB Carbon ones)?

(sorry about all these questions, I'm so excited about PB Cocoa :) )

Re: Development for Cocoa is underway!

Posted: Tue Jul 24, 2012 3:46 pm
by srod
Fred wrote:It's not possible to call directly objective C call as WinAPI, as it's not really calls, but messages. And the syntax doesn't fit regular API calls. The best for now is to do tiny C wrappers and use ImportC , that's how I did for the IDE and it works well.
Right, best continue working through the ObjectiveC text books then. Must admit that I like ObjC, I like it a lot. A close 2nd to PB of course!

Re: Development for Cocoa is underway!

Posted: Tue Jul 24, 2012 4:41 pm
by fsw
srod wrote:Wow, how many Basic compilers 'out there' support OSX Cocoa?
As far as I know there is RealBasic (uses a VM) and Objective-Basic (creates Objective-C files).

IMHO PureBasic is the best.
Really looking forward to the PureBasic beta. 8)

Re: Development for Cocoa is underway!

Posted: Tue Jul 24, 2012 4:47 pm
by Polo
There's Blitzmax as well, though I'm not sure it's updated anymore.

Re: Development for Cocoa is underway!

Posted: Tue Jul 24, 2012 5:27 pm
by wilbert
Fred wrote:That said, wilbert wrote an objectiveC wrapper for PB to do some call
For simple message sending, things can also be done using imports.
I did this example http://www.purebasic.fr/english/viewtop ... 19&t=48917 using imports only.

For those interested in how things work, this explains some low level functions
https://developer.apple.com/library/mac ... rence.html

@Fred, maybe you could consider updating this list when the Cocoa version is released
http://www.purebasic.fr/blog/?p=336 ( API Programming: What’s behind the PB GUI objects )
It would be great to know what kind of objects are used and how to get a reference to the object.
For the WebGadget for example, it would be very helpful to be able to get the WebView object to send messages to.