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: Ken Ferry
Subject: Re: NSToolbar (was Re: Portability/Compatability between GNUstep <---> Cocoa...)
Date: Tue, 13 Jan 2004 23:12:10 -0500

Okay, one more go on this (the list seems to only be sending some things through?).

The code below doesn't work right for some reason (besides undefined macros on Mac OS X). [NSImageView new] returns nil. I don't know what's wrong with that, but I can check the info you're interested in explicitly, and I see that NSImageView does implement setAction:, and NSImageCell does not. A message of setAction: sent to an NSImageCell drops through to the NSCell implementation of setAction:, which does indeed throw an exception.

Hope that's what you were after!

-Ken


On Jan 13, 2004, at 5:55 PM, Fred Kiefer wrote:

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

   Written by: Fred Kiefer <address@hidden>
   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;
}
_______________________________________________
Discuss-gnustep mailing list
address@hidden
http://mail.gnu.org/mailman/listinfo/discuss-gnustep





reply via email to

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