This sample contains a program illustrating how to show swatches of color in a labels-like menu in your own application. It also illustrates how to add a user adjustable color item to the menu that can be changed by way of the color picker interface.
Behind the scenes, the color swatches in the menu are implemented as color icon resources. The only real tricky part here is finding the correct place to save the color in the color icon resource.
Of interest in this example:
Routines are provided that allow you to get/set particular color table elements inside of a cicn resource.
You may incorporate this sample code into your applications without restriction, though the sample code has been provided "AS IS" and the responsibility for its operation is 100% yours. However, what you are not permitted to do is to redistribute the source as "DSC Sample Code" after having made changes. If you're going to re-distribute the source, we require that you make it clear in the source that the code was descended from Apple Sample Code, but that you've made changes.
Files:
':ColorPopUpMenus.prj Data:' - codewarrior pro project data.
:obj: - object files created during the build process.
ColorPopUpMenus - compiled executable
ColorPopUpMenus.c -source code for this sample.
ColorPopUpMenus.h - definitions for routines exported from ColorPopUpMenus.c
ColorPopUpMenus.prj - codewarrior pro project file that builds ColorPopUpMenus.
ColorPopUpMenus.r - MPW Rez definitions used for mpw builds.
ColorPopUpMenus.rsrc - resources used in ColorPopUpMenus.h
MakeFile - MPW make file that builds ColorPopUpMenus.