Re: [NTLK] How to add pictures to NTK project?

From: Frank Gruendel <>
Date: Mon Dec 22 2008 - 15:39:35 EST

I think you wrote that you are working on a Mac, so this might not
be helpful, but here is how you can do it on a PC.

The code below requires your images to be in a folder "Bitmaps"
which is on the same level as your .ntk file.

Somewhere in your project data file you would define an image like

DefConst('kStylesIcon, getBMPAsBits("Bitmaps\\YourImage.bmp", nil));

Or, if you want to define more than one image in a compact way, you
define an array like this:

DefConst('kTitleIconArray, [
        getBMPAsBits("Bitmaps\\YourImage0.bmp", nil),
        getBMPAsBits("Bitmaps\\YourImage1.bmp", nil),
        getBMPAsBits("Bitmaps\\YourImage2.bmp", nil),
        getBMPAsBits("Bitmaps\\YourImage3.bmp", nil),
        getBMPAsBits("Bitmaps\\YourImage4.bmp", nil),

Assuming that, for example, you want to assign the first of these
icons to
the icon slot of a protoTitle, you would do it like this:

setValue(YourProtoTitle, 'titleIcon, kTitleIconArray[0]);

Hope it helps


-- Newton software and hardware at

The NewtonTalk Mailing List -
The Official Newton FAQ -
The Newton Glossary -
WikiWikiNewt -
Received on Mon Dec 22 15:39:46 2008

This archive was generated by hypermail 2.1.8 : Mon Dec 22 2008 - 16:30:00 EST