> int main(int a, char* av) {
> NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[quoted text clipped - 4 lines]
> It compiles and runs but NSRunAlertPanel does not show a popup.
> Any ideas why ?
I believe this function needs an instance of NSApplication to show your
panel.
> I need a cocoa wrapper to start an X11 application and if X11 is not
> available the wrapper should simply popup a message box. Thats all.
I think you can't use Cocoa. Look at this Carbon function:
StandardAlert
Displays a standard alert box.
OSErr StandardAlert (
AlertType inAlertType,
ConstStr255Param inError,
ConstStr255Param inExplanation,
const AlertStdAlertParamRec * inAlertParam,
SInt16 * outItemHit
);
patrick
Lothar Scholz - 28 Jan 2005 13:52 GMT
>> int main(int a, char* av) {
>> NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[quoted text clipped - 7 lines]
>I believe this function needs an instance of NSApplication to show your
>panel.
Yuups, thats it
NSApplication* a = [[NSApplication alloc] init];
in front of the code and it works well.
Patrick Machielse - 28 Jan 2005 15:20 GMT
> >> int main(int a, char* av) {
> >> NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
[quoted text clipped - 10 lines]
>
> in front of the code and it works well.
I overlooked that option ;-)
patrick