摘要: -(void)addButton{ NSButton* pushButton = [[NSButton alloc] initWithFrame: NSMakeRect(100, 100, 100, 100)]; pushButton.bezelStyle = NSRoundedBezelStyle; [pushButton setTarget:self]; [pushButton setAction:@selector(buttonClick:)]; [self.window.contentView addSubview:pushBut... 阅读全文
posted @ 2013-08-22 10:48 酱酱爱 阅读(5967) 评论(0) 推荐(0) 编辑
摘要: DBSCustomView *view = [[DBSCustomView alloc] initWithFrame:NSMakeRect(100, 100, 100, 100)]; [self.window.contentView addSubview:view];//特别地,这里设置坐标是用NSMakeRect,如果用成了CGRectMacke(0,0,10,10);编译不会出错,但运行是错误的,什么都看不到.NSWindow,NSView都是继承自。NSResponder。应该说他们只是兄弟关系,NSWindow里有个contentView另外,对NSView修改背景颜色,必须覆盖NS. 阅读全文
posted @ 2013-08-22 10:45 酱酱爱 阅读(5449) 评论(0) 推荐(0) 编辑