discuss-gnustep
[Top][All Lists]
Advanced

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

Re: porting from Cocoa help


From: Sheldon Gill
Subject: Re: porting from Cocoa help
Date: Sat, 11 Mar 2006 08:40:21 +0800
User-agent: Thunderbird 1.5 (Windows/20051201)

Anurodh Pokharel wrote:
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.

Good idea.

 The app i am porting is OSXnews  ( http://osxnews.sf.net )

Great. Have you put your current porting efforts into a branch?

I have a few questions. 1. does NSAlert exist in gnustep? I had to comment out every instance
to get it to compile2.

Yes it does. You need "#import <NSAlert.h>" to make it happen.
Note also that the behaviour is somewhat different from Cocoa. You need to 
change
        [myAlert runModal]
to
        NSRunCriticalAlertPanel()

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

NS_DURING
  {
    // try_block
  }
NS_HANDLER
  {
    // catch_block
  }
NS_ENDHANDLER

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

No, it doesn't. icns files derive from resources and are a mac-only format.
Convert the icns images to TIFF images for use in GNUstep.

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

  [myToolbarItem setAction: @selector(doAction)];

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

nib2gmodel on MacOS-X to convert to gmodel

Gorm to convert gmodel to gorm (GNUstep equivalent of nib)

You can find more info here:
<http://mediawiki.gnustep.org/index.php/Writing_portable_code>


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.

To the best of my knowledge there isn't a current webkit port.

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.

GNUstep has had <Cocoa/Cocoa.h> for a while now which contains the bool, true, false definitions.

Which version of the libraries are you using?


Regards,
Sheldon




reply via email to

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