• 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
FW: Classes for a dummy <NSImage access>.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FW: Classes for a dummy <NSImage access>.


  • Subject: FW: Classes for a dummy <NSImage access>.
  • From: jean-michel daix <email@hidden>
  • Date: Wed, 10 Oct 2001 13:08:37 +0200

Thanks.

Well, the compilation works. But I cannot reach the image. I test is Rect
size and it gives me {{0,0}{0,0}}. May be my "(NSImage *)image" isn't good :

- (NSImage *)image {
return BackGroundImage;
}


-----------------------------------
jean-michel daix / email@hidden
Sorry, I9m French !

visit <http://www.adforum.com>



> I'm not well versed in Obj-C yet but I think this is close to accurate (you
> may want to see what others have to say first though). Byt here goes
> anyay...
>
> Well, your main program needs an instance of the class BackGround. You may
> already have done this but in case not you can do it like so: -
>
> // somewhere in your code / function or whatever
> BackGround *theBackGround = [[BackGround alloc] init];
>
> // Then you can get hold of the image like this: -
> NSImage *localCopyOfImage = [[theBackGound image] retain];
>
> // When you've finished wih the image...
> [localCopyOfImage release];
>
> Brad
>
>>
>> BackGround.h :
>>
>> #import <Cocoa/Cocoa.h>
>>
>> @interface BackGround : NSObject {
>> NSImage *backgroundImage;
>> }
>>
>> /* Initialization and De-Allocation */
>> - (id)init;
>> - (void)dealloc;
>>
>> // return backgroundImage
>> - (NSImage*)image;
>>
>> // modify backgroundImage
>> - (void)setImage:(NSImage *)image;
>>
>> @end
>>
>> My question is simple and stupid : How do I access my
>> backgroundImage from
>> the main part of my program ?
>>
>> I have used @class BackGround; in my header and #import
>> "BackGround.h" in my
>> source but there I don't know how to reach my image. Please, help :(
>>
>>
>> -----------------------------------
>> jean-michel daix / email@hidden
>

------ Fin du message transfiri


  • Follow-Ups:
    • FW: Classes for a dummy dummy <NSImage access>.
      • From: jean-michel daix <email@hidden>
  • Prev by Date: Re: DLL hell (was: Cocoa newbie frustration)
  • Next by Date: RE: Or
  • Previous by thread: RE: Classes for a dummy <NSImage access>.
  • Next by thread: FW: Classes for a dummy dummy <NSImage access>.
  • Index(es):
    • Date
    • Thread