ftp.nice.ch/pub/next/developer/objc/appkit/DrawingInAnAppIcon.README

This is the README for DrawingInAnAppIcon.N.bs.tar.gz [Download] [Browse] [Up]

¬
Jim Million    uunet!wiltel!jmillion    October 1992    				              

Fone.app (v1.0)

This is a simple example to demonstrate how to draw within an application's icon.
Basically,  here's what you do... 1] Get the application's icon window content view,
2] Composite an NXAppTile image at 0,0 of that content view,  3] Do any other 
drawing/compositing centered within that content view.
¬

Important Files...

¬ FoneController.[hm] manages the display of the application icon. 

The following code is relevant:

(in appDidInit:) - how to get the application's icon window content view...
																											appIconContentView = [[NXApp appIcon] contentView];

						 														     - how to get the NXAppTile image...
																											appTile = [NXImage findImageNamed: "NXAppTile"];

(in _display:) 	  - drawing (location of composite is the significant thing here)...
																												[appIconContentView lockFocus];
	                              [appTile composite:NX_SOVER toPoint:&contentViewOrigin]; // 0,0								                       	
                               [anImage composite:NX_SOVER toPoint:&centerPoint];  // centered
	                              [appIconContentView unlockFocus];
	                              [appIconContentView display];


Notes...

¬ From DeveloperReleaseNotes / AppKit.rtf...  A new named image, NXAppTile,  has been added to allow apps to draw in their application icon without destroying the standard look. Developers who want to draw in their application icons should find this image with findImageNamed: and composite it at the lower left corner of the content view of the window. Then any custom drawing should be done above, centered on this image.
¬

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.