• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Adding an NSImageView to an NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adding an NSImageView to an NSView


  • Subject: Adding an NSImageView to an NSView
  • From: Duncan Campbell <email@hidden>
  • Date: Thu, 7 Apr 2005 16:59:53 +1000

Hey folks.

I'm trying to add an NSImageView subclass to an NSView. Useless snippet:

myImageView = [[NSImageView alloc] init];
[myImageView setImage:[NSImage imageNamed:@"myimage.tiff"]];
[myView addSubview: myImageView];

This seems to work fine (i am setting up the NSRect position of the NSImageView correctly), except my image never shows. I have tried writing some custom coloring code in the NSImageView and it does show correctly on the NSView (i.e. i see a colored square, tracking rects work etc.) - it's just the image that isn't showing.

I have also tried replacing the NSImageView with an NSButton and it shows the image correctly (so it's not something silly like a typo in the image filename).

Anyone have a clue what's (not) going on?

Cheers.

---------------------------------------------------------------
Duncan Campbell
http://www.duncanandsarah.com/duncan
---------------------------------------------------------------

Are we running light with overbyte?
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Adding an NSImageView to an NSView
      • From: "Geert B. Clemmensen" <email@hidden>
  • Prev by Date: Re: C++ string and UTF8
  • Next by Date: Re: Adding an NSImageView to an NSView
  • Previous by thread: Re: Memory leak in simple code?
  • Next by thread: Re: Adding an NSImageView to an NSView
  • Index(es):
    • Date
    • Thread