Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Loading images with Coacoa. (newbie)

Loading images with Coacoa. (newbie)
Thread Tools
Fresh-Faced Recruit
Join Date: Feb 2001
Location: Canada
Status: Offline
Reply With Quote
Feb 11, 2001, 10:18 AM
 
How would one display an image in coacoa using NSImageView.

In Java i would do:

JLabel pict;

pict.setIcon( new Icon( "filename" ) );
//The file exists in the directory of the class files.

something to that effect. how would i do that in coacoa.

So far I've set up:

- (void)awakeFromNib
{
NSImage *image = [NSImage imageNamed:[picts objectAtIndex: 0]];
[ pict setImage:image ];
}

where picts is an array of file names, and pict is the NSImageView. I know I'm doing something wrong cause the program attempts to launch but then quits before displaying anything.

I'm really new to this so don't be afraid to dumb this down.

Also, how does one post to the omnigroup macosx-dev maillist?

TIA
     
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status: Offline
Reply With Quote
Feb 11, 2001, 12:40 PM
 
You can use NSImageView the - (void)setImageNSImage *)image method is probably what you want. You can also render pictures in your own custom NSView using - (void)compositeToPointNSPoint)aPoint operationNSCompositingOperation)op in NSImage. If your picture isn't going to change much you can just drag an NSImageView into a window in interface builder and set the image that it displays in the attributes part of the inspector. To let interface builder know about the image, just drag the image into the images tab. You address the image by name, in the attributes part of the inspector. No coding is necessary if you do it that way.
     
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status: Offline
Reply With Quote
Feb 11, 2001, 12:40 PM
 
double post

[This message has been edited by Dalgo (edited 02-11-2001).]
     
Fresh-Faced Recruit
Join Date: Feb 2001
Location: Canada
Status: Offline
Reply With Quote
Feb 11, 2001, 02:57 PM
 
I didn't know you can do that.

I'll try it out. Thanks.
     
Forum Regular
Join Date: Dec 2000
Location: Rehoboth Beach,DE USA
Status: Offline
Reply With Quote
Feb 13, 2001, 03:56 AM
 
To subscribe to macosx-dev@omnigroup.com go to http://www.omnigroup.com/community/d...ts/macosx-dev/
there are instructions there
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:21 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2