Changed the uiMainSteps() API as the GTK+ port will need it to be done this way...
This commit is contained in:
parent
da4b396aaf
commit
d4492c06a9
|
@ -159,12 +159,13 @@ void uiMain(void)
|
|||
[realNSApp() run];
|
||||
}
|
||||
|
||||
void uiMainSteps(void)
|
||||
void uiMainSteps(void (*f)(void *), void *data)
|
||||
{
|
||||
isRunning = ^{
|
||||
return stepsIsRunning;
|
||||
};
|
||||
stepsIsRunning = YES;
|
||||
(*f)(data);
|
||||
}
|
||||
|
||||
// see also:
|
||||
|
|
13
test/main.c
13
test/main.c
|
@ -39,6 +39,12 @@ uiTab *mainTab;
|
|||
uiBox *(*newhbox)(void);
|
||||
uiBox *(*newvbox)(void);
|
||||
|
||||
static void stepsLoop(void *data)
|
||||
{
|
||||
while (uiMainStep(1))
|
||||
;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
uiInitOptions o;
|
||||
|
@ -161,11 +167,8 @@ int main(int argc, char *argv[])
|
|||
uiControlShow(uiControl(w));
|
||||
if (!steps)
|
||||
uiMain();
|
||||
else {
|
||||
uiMainSteps();
|
||||
while (uiMainStep(1))
|
||||
;
|
||||
}
|
||||
else
|
||||
uiMainSteps(stepsLoop, NULL);
|
||||
printf("after uiMain()\n");
|
||||
uiUninit();
|
||||
printf("after uiUninit()\n");
|
||||
|
|
2
ui.h
2
ui.h
|
@ -45,7 +45,7 @@ _UI_EXTERN void uiUninit(void);
|
|||
_UI_EXTERN void uiFreeInitError(const char *err);
|
||||
|
||||
_UI_EXTERN void uiMain(void);
|
||||
_UI_EXTERN void uiMainSteps(void);
|
||||
_UI_EXTERN void uiMainSteps(void (*f)(void *), void *data);
|
||||
_UI_EXTERN int uiMainStep(int wait);
|
||||
_UI_EXTERN void uiQuit(void);
|
||||
|
||||
|
|
Loading…
Reference in New Issue