You will need to learn some Objective-C and Cocoa regardless of what else you want to do, because there isn't "one system level call" to present a modal panel.
At minimum, you will need to create an NSWindowController subclass for your panel, which will act as File's Owner of its nib file and manage the interaction between its controls and whatever data it's manipulating. Then you'll need to pass this to -[NSApplication runModalForWindow:]
and handle the result, or to -[NSApplication beginModalSessionForWindow:]
and handle running and/or stopping the modal session yourself.
This means writing coding against the Cocoa frameworks in Objective-C.
Fortunately, since you're just starting with a message, a text field, and a couple of buttons, this will be pretty easy. But it's not just a matter of a hypothetical NSGetTextInput()
function — Cocoa eschews such things in favor of abstractions that can be pieced together in straightforward and extensible ways.
For example, if you decide you don't just need text input but also a checkbox, you'd have to replace your hypothetical NSGetTextInput()
with something like the above. But by doing the above in the first place, adding that checkbox becomes a few seconds of extra work. Or adding interesting validation to your text input. Or pre-populating your text input with data from an object. Or implementing a time-out (including presenting a countdown timer) on your modal dialog. (Modality is strongly disfavored nowadays...) Or any of a number of other changes.