Cocoa开发中的界面颜色混合、撤销重做与异常调试
1. 为GUI添加混合颜色
在开发过程中,我们需要将混合颜色样本添加到文档窗口。首先要在 CMDocument.h 文件中为每个颜色样本添加一个输出口。这些新的输出口将连接到 CMColorBlendView 的实例。同时,在文件顶部添加 @class 声明,告知编译器 CMColorBlendView 是一个类名,这样可以避免导入类的头文件,提高编译速度并减少头文件之间的依赖。以下是 CMDocument.h 文件的代码:
#import <Cocoa/Cocoa.h>
@class CMColorBlendView;
@interface CMDocument : NSPersistentDocument
@property (weak) IBOutlet CMColorBlendView *multiplyBlendView;
@property (weak) IBOutlet CMColorBlendView *screenBlendView;
@property (weak) IBOutlet CMColorBlendView *overlayBlendView;
@property (weak) IBOutlet CMColorBlendView *darkenBlendView;
@property (weak) IBOutlet CMColorBlendView *lightenBlendView;
@proper
超级会员免费看
订阅专栏 解锁全文
39

被折叠的 条评论
为什么被折叠?



