discuss-gnustep
[Top][All Lists]
Advanced

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

Re: New to GNUmake


From: Lars Sonchocky-Helldorf
Subject: Re: New to GNUmake
Date: Wed, 10 Apr 2002 15:20:44 +0200

Pierre Vaudrey <pierre.vaudrey@wanadoo.fr>
> 
> Le lundi 8 avril 2002, à 04:57 PM, Lars Sonchocky-Helldorf a écrit :
> 
> >> I'm new to GNUmake and I would like to build CodeEditor from
> >> http://www.gnustep.net/software_developer.html
> >> on  Mac OS X 10.1.3
> >> I guess I need first to install gnustep-make-1.3.0
> >> Is help for beginners offtopics on this list ?
> >>
> >
> > If you wan't to use it with Cocoa, you need to port it (should be not 
> > that
> > complicated, mostly only a few fixes are needed). In that case you 
would
> > use Apples Project Builder, so there is no need for GNUstep-make. A 
good
> > example for such a "hybrid" GNUstep/Cocoa App is Affiche 
> > (http://www.collaboration-world.com/affiche/).
> >
> I'm trying to build CodeEditor in Apple's Project Builder
> Could somebody help me to solve the following error:
> "2002-04-10 10:44:05.965 CodeEditor[1593] *** Assertion failure in 
> -[NSMenuItem initWithTitle:action:keyEquivalent:], NSMenuItem.m:84
> 2002-04-10 10:44:05.989 CodeEditor[1593] Exception raised during posting 

> of notification.  Ignored.  exception: Invalid parameter not satisfying: 

> charCode != nil"
> 
> Pierre Vaudrey
> email pierre.vaudrey@wanadoo.fr
> 

While porting Gomoku.app to Cocoa I made the experience that it is 
actually easier to create the menus with Interface Builder. In Gomoku.app 
I did it like this:

in main() I added the following:

int main (int argc, char **argv) {
.
.
.
#ifdef GNUSTEP                          // added (the following ivars 
aren't needed under Cocoa)
        NSMenu *mainMenu;
        NSMenu *menu;
        NSMenuItem *menuItem;
#endif                                          // added
.
.
.
#ifndef GNUSTEP                         // added
        NSApplicationMain(argc, argv);          // added (This starts the 
app and loads the nibs (for menus))
#endif                                          // added

#ifdef GNUSTEP                          // added
//GNUSTEP menu creation here
//GNUSTEP app start here                        // the following code is 
from Gomoku. In this case controller is the apps delegate. Since Cocoa 
starts the app differently you have to import your
                                                // apps delegate into your 
MainMenu.nib (Click the classes tab of your nib, choose Classes>Read 
Files... from the menu and import your apps
                                                // delegates header file. 
Your class will show up in the classes hierarchy. choose 
Classes>Instantiate from the menu
        controller = [Controller new: cnt];
        [app setDelegate: controller];
        [app run];
#endif                                          // added
.
.
.
}

In your apps delegate add the following:

- (void) awakeFromNib {                 // added (this gets called 
automatically after your apps nib got loaded)
        [self init];                            // added (choose a proper 
initialisation for your object (otherwise it will look like layout in IB))
}

Hope that helps, good luck, Lars



reply via email to

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