NSComboBox into NSAlert
First of all I'm kind of new in Objc. (so try to explain me like. . . for 开发者_JAVA百科dummies XD) Well my question is: Is there any way to show a NSComboBox inside a NSAlert? that's it! I've check the documentations, an it says that it is possible to show a NSTextView, but I'm wandering if anyone has done this before (with the NSComboBox), a code example would be really useful!
Thank's in advance!!!
You might want to read the documentation on setAccessoryView:
and layout
at this URL. I don't know if you can insert a combobox there and if you can somehow get a return from it.
Eureka!!!
is really simple, you just have to remember that NSButton, NSTextField, NSComboBox. . . (etc) inherits from NSView so, you just need to send the object you need into your NSAlert like this:
[specialtyAlert setAccessoryView:specialtyOptions];
where specialtyAlert is an instance of NSAlert, and specialtyOptions is an instance of NSComboBox (but it could be an instance of NSButton or any other GUI object).
精彩评论