-(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
{
    
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
  • 2022-01-24
  • 2021-11-26
猜你喜欢
  • 2021-04-11
  • 2021-09-27
  • 2022-12-23
  • 2021-05-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案