[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: porting from Cocoa help

From: Sašo Kiselkov
Subject: Re: porting from Cocoa help
Date: Fri, 10 Mar 2006 20:48:50 +0100
User-agent: Internet Messaging Program (IMP) 3.2.5

Quoting Anurodh Pokharel <address@hidden>:

> Well, it's been exactly since i last posted about porting a cocoa app. I
> tried again today an was actually able to compile everything in
> ProjectCenter with a few changes. The main change on my end was that apple
> got
> rid of the dock in mail.app so i got rid of it too. That made porting a
> lot easier.
>  The app i am porting is OSXnews  ( http://osxnews.sf.net )
> I have a few questions.
> 1. does  NSAlert exist in gnustep? I had to comment out every instance
> to get it to compile2.

Hmm, the latest gnustep-gui library seems to include it (though I haven't used
it), so I guess the answer should be "yes" here.

> I know that @try{} catch does not work in the version
> of gcc that ships with non Darwin systems. How do you guys get around it?
> I commented every instance, but that will limit the stability of the
> application

You can use the old-fashioned OpenStep style macros:

  ... exception raising code ...
  ... exception handler code ...

or you can get a GCC 4.0 or 4.1 which do have @try support built in (I use this
exception scheme at work in our product - a GNUstep app).

> 3. How do you give the application an icon? does it take icns files?

Nope, but there are ways:

 - if you use plain gnustep-make you can specify (for example):


and then include the OSXnews.tiff file in your resource files
(OSXnews_RESOURCE_FILES=OSXnews.tiff etc.)

 - if you use an IDE, that should provide a built-in way how to specify the

> 4.  NStoolbar uses @selector to specify the action, i had to comment out
> all of that too. How is this done in gnustep.

I don't understand. Of course GNU GCC knows @selector.

> 5. i have the old style (non XML ) nib files. What should i use to
> convert them to gorm?

Gregory will know better about this one, but I think using nib2gmodel should
work just fine.

> 6. Webkit, where can i get a copy of the gnustep version. The app uses
> webkit to display newsgroup postings in a nice formatted way. I can live
> without it, but it would be nice to have simply to keep the source in
> the OSX and GS versions similar.

Currently, there is no version of WebKit for non-Apple systems, as WebKit uses
Objective-C++ extensively and GNU GCC was lacking support for ObjC++ until not
long ago. However, the newest GNU GCC 4.1 does have ObjC++, so if you want to,
we'd be happy to see a port of it finally. :-)

> beyond that, the application now compiles (without the nib files, yay!
> late binding!)  on linux with gnustep and hopefully, we will have GSNews,
> a small fast NNTP newsreader for gnustep


> ====
> Oh yeah, for anyone who might see this in the future via google gorups,
> to get round the missing  coca.h thing, make a folder called Cocoa in
> the project directory and create a file there called Cocoa.h with the
> following contents:
> #import <Foundation/Foundation.h>
> #import <AppKit/AppKit.h>
> typedef BOOL bool;
> #define  true YES;
> #define false NO;
> this  makes Cocoa apps a lot easier to port to GNUStep since it requires
> no changes to the headers included and fixes the bool issue.

What the heck? Did Apple change YES/NO to true/false and BOOL to bool? When,
why, how?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]