Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在可可应用程序中动态创建 NSButton 很好。但是,一旦应用程序启动,我想在创建的 NSButton 上执行右键单击,或者希望为 NSBUtton 提供上下文菜单。如何做到这一点?
子类 NSButton 并覆盖 mousedown 或事件菜单