NSButton添加事件

-(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:pushButton];


}


-(void)buttonClick:(id)sender
{
    
}

 

posted @ 2013-08-22 10:48  酱酱爱  阅读(5967)  评论(0编辑  收藏  举报