0

First of all I'm kind of new in Objc. (so try to explain me like. . . for 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!!!

Ordiel
  • 2,442
  • 3
  • 36
  • 52

2 Answers2

1

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.

Rudy Velthuis
  • 28,387
  • 5
  • 46
  • 94
  • I've already check the documentation, and it's not really useful for what I want to do but thank you anyway – Ordiel Aug 02 '11 at 22:24
1

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).

Ordiel
  • 2,442
  • 3
  • 36
  • 52