discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSToolbar (was Re: Portability/Compatability between GNUstep <---> C


From: Fred Kiefer
Subject: Re: NSToolbar (was Re: Portability/Compatability between GNUstep <---> Cocoa...)
Date: Tue, 13 Jan 2004 23:55:49 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821

Alex Perez wrote:

I have several OS X systems. If you guys can supply me with EXACTLY what code I need and tell me what behavior you need to know about, I can do it for you, but I dont have time to putz around trying to figure out what it is that you want to know. For that matter, if ANYONE has any questions about OS X and wants me to test something, shoot me an e-mail.

I hope that you don't regret this offer, as I have several unresolved Cocoa questions. Here is the code for the NSImageView one. It may need a bit of tweaking on MacOSX, but is the minimal test application on GNUstep.

Cheers
Fred
/* 
   Tester for ImageView
   Copyright (C) 2004 Free Software Foundation, Inc.

   Written by: Fred Kiefer <FredKiefer@gmx.de>
   Created: January 2004

   This file is part of the GNUstep Base Library.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
*/
#include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSException.h>
#include <Foundation/NSString.h>
#include <AppKit/NSApplication.h>
#include <AppKit/NSImageView.h>
#include <math.h>

int main (int argc, const char *argv[])
{
  CREATE_AUTORELEASE_POOL(pool);
  NSImageView *view;
  NSImageCell *cell;

  [NSApplication sharedApplication];
  view = [NSImageView new];
  cell =[view cell];
  NS_DURING
    {
      [view setTarget: view];
      NSLog(@"NSImageView does implement setTarget:");
    }
  NS_HANDLER
    {
      NSLog(@"NSImageView does not implement setTarget:");
    }
  NS_ENDHANDLER

  NS_DURING
    {
      [cell setTarget: view];
      NSLog(@"NSImageCell does implement setTarget:");
    }
  NS_HANDLER
    {
      NSLog(@"NSImageCell does not implement setTarget:");
    }
  NS_ENDHANDLER

  RELEASE(pool);
  return 0;
}

reply via email to

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