macosx
This commit is contained in:
parent
56953a9c4b
commit
a32d596782
|
@ -1,4 +1,4 @@
|
||||||
#include <Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -173,7 +173,7 @@ char *sdl_path(char *p)
|
||||||
}
|
}
|
||||||
|
|
||||||
static char file_path[PATH_MAX];
|
static char file_path[PATH_MAX];
|
||||||
NavEventUPP gNavEventHandlerPtr;
|
//NavEventUPP gNavEventHandlerPtr;
|
||||||
|
|
||||||
static void dlg_callback(
|
static void dlg_callback(
|
||||||
NavEventCallbackMessage callBackSelector,
|
NavEventCallbackMessage callBackSelector,
|
||||||
|
@ -206,7 +206,7 @@ static void dlg_callback(
|
||||||
}
|
}
|
||||||
case kNavCBTerminate: {
|
case kNavCBTerminate: {
|
||||||
NavDialogDispose (callBackParms->context);
|
NavDialogDispose (callBackParms->context);
|
||||||
DisposeNavEventUPP (gNavEventHandlerPtr);
|
// DisposeNavEventUPP (gNavEventHandlerPtr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,16 +223,16 @@ char *open_file_dialog(void)
|
||||||
if (err != noErr)
|
if (err != noErr)
|
||||||
return NULL;
|
return NULL;
|
||||||
dialogAttributes.modality = kWindowModalityAppModal;
|
dialogAttributes.modality = kWindowModalityAppModal;
|
||||||
gNavEventHandlerPtr = NewNavEventUPP( dlg_callback );
|
// gNavEventHandlerPtr = NewNavEventUPP( dlg_callback );
|
||||||
err = NavCreateGetFileDialog( &dialogAttributes, NULL,
|
err = NavCreateGetFileDialog( &dialogAttributes, NULL,
|
||||||
gNavEventHandlerPtr, NULL, NULL,
|
dlg_callback/*gNavEventHandlerPtr*/, NULL, NULL,
|
||||||
NULL, &openDialog );
|
NULL, &openDialog );
|
||||||
if (err != noErr)
|
if (err != noErr)
|
||||||
return NULL;
|
return NULL;
|
||||||
err = NavDialogRun( openDialog );
|
err = NavDialogRun( openDialog );
|
||||||
if ( err != noErr ) {
|
if ( err != noErr ) {
|
||||||
NavDialogDispose( openDialog );
|
NavDialogDispose( openDialog );
|
||||||
DisposeNavEventUPP( gNavEventHandlerPtr );
|
// DisposeNavEventUPP( gNavEventHandlerPtr );
|
||||||
}
|
}
|
||||||
if (!file_path[0])
|
if (!file_path[0])
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue