can't edit NSTextField in sheet at runtime

前端 未结 2 1039
粉色の甜心
粉色の甜心 2020-12-25 12:32

When clicking on a button, I\'d like to display a sheet with an email+password prompt with options to save and cancel. The UI is all set up, the actions are in place, and th

2条回答
  •  难免孤独
    2020-12-25 12:59

    It turns out that I haphazardly found the solution, which I will now post for posterity...

    The view that gets used as the sheet (NSWindow or NSPanel) needs to have a title bar. As soon as I toggled this in Interface Builder's inspector (Window → Appearance → Title Bar checkbox), I recompiled and the NSTextFields highlighted, tabbed, and accepted input like they would in any other view. Not sure why the title bar makes a difference, but there you have it.

提交回复
热议问题