After I read a paper from Ludovic Marcotte : Renaissance—A Cross-Platform Development Tool for Linux and Mac OS X
http://www.linuxjournal.com/article.php?sid=7102
" Once the file has been created, we need to create the Mac OS X project file and build the application. To do so, start the Project Builder application and proceed with the following steps:


1. From the File menu, choose the New Project... menu item and select Cocoa Application. Click on the Next button.
2. Specify the project name (TiffViewer) and the project directory, then click on the Finish button.
3. Select the Classes node in the Groups & Files panel and then click on the Add Files... menu item from the Project menu. Add the AppController.m and ImageModel.m files. Those are the same files used under GNUstep.
4. Expand the Other Sources node and delete the main.m file. We don't need this file.
5. Expand the Resources node and double-click on MainMenu.nib. This launches Interface Builder. From Interface Builder's MainMenu.nib window, delete MainMenu and Window by clicking on the corresponding icons and choosing Delete from the Edit menu. Save everything and then quit Interface Builder. We need to do so because Renaissance can provide the application menu using our gsmarkup file.
6. Select the Resources node and add the Cocoa-Menu.gsmarkup and TiffViewer.gsmarkup files, as you did in Step 3.
7. Expand the Frameworks and Linked Frameworks nodes and click on the Add Frameworks... menu item from the Project menu. Add the Renaissance.framework located in the /Library/Frameworks directory.
8. Finally, from the Build menu in Project Builder, choose Build and Run. This compiles and launches the application. "


With this method I successfully ran the xample of Ludovic and simple ObjC examples from the Renaissance tutorial .
I'm currently working on a CamelBones project and I would like test the port from OSX to Linux with the same method
I tried to run the Renaissance example of CamelBones Examples within Project Builder on Jaguar :
The main.pl file is :


use strict;
use warnings;

use CamelBones qw(:All);

use MyController;

# Get a reference to the shared NSApplication object
our $nsApp = NSApplication->sharedApplication;

# Create the top-level controller object
our $controller = new MyController;

# Make the controller the delegate of the application
$nsApp->setDelegate($controller);

# Load the menu
my $topLevelObjects = NSMutableArray->array();
my $table = NSMutableDictionary->dictionary();
$table->setObject_forKey($nsApp, "NSOwner");
$table->setObject_forKey($topLevelObjects, "NSTopLevelObjects");
NSBundle->loadGSMarkupFile_externalNameTable_withZone("Menu-OSX", $table, undef);
#NSBundle->loadGSMarkupNamed_owner("Menu-OSX", $controller);
# Start the NSApplication object's run loop
$nsApp->run;


and the Controller package is :

package MyController;

use CamelBones qw(:All);

our @ISA = qw(Exporter);
our %OBJC_EXPORT = ();

sub new {
    # Typical Perl constructor
    # See 'perltoot' for details
    my $proto = shift;
    my $class = ref($proto) || $proto;
    my $self = {
    };
    bless ($self, $class);

    return $self;
}

sub applicationDidFinishLaunching {
    my ($self, $notification) = @_;

# Read the Renaissance interface description
my $topLevelObjects = NSMutableArray->array();
my $table = NSMutableDictionary->dictionary();
$table->setObject_forKey($self, "NSOwner");
$table->setObject_forKey($topLevelObjects, "NSTopLevelObjects");
NSBundle->loadGSMarkupFile_externalNameTable_withZone("Window", $table, undef);
#NSBundle->loadGSMarkupNamed_owner("Window", $notification);
}


sub printHello {
        my ($self, $sender) = @_;
        
        NSLog("Hello, world!\n");
}

1;
but I raised the following error :
2004-07-20 14:42:44.533 Renaissance[1850] Unhandled argument type ^{_NSZone=} in position 2 of call to loadGSMarkupFile:externalNameTable:withZone:
2004-07-20 14:42:44.889 Renaissance[1850] Unhandled argument type ^{_NSZone=} in position 2 of call to loadGSMarkupFile:externalNameTable:withZone:


Could anyone help me ?

Pierre

Reply via email to