Implemented uiMainSteps() on GTK+.
This commit is contained in:
parent
d4492c06a9
commit
c001c164f1
24
unix/main.c
24
unix/main.c
|
@ -34,6 +34,30 @@ void uiMain(void)
|
||||||
gtk_main();
|
gtk_main();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct mainStepsData {
|
||||||
|
void (*f)(void *);
|
||||||
|
void *data;
|
||||||
|
};
|
||||||
|
|
||||||
|
static gboolean mainSteps(gpointer data)
|
||||||
|
{
|
||||||
|
struct mainStepsData *d = (struct mainStepsData *) data;
|
||||||
|
|
||||||
|
(*(d->f))(d->data);
|
||||||
|
// TODO call gtk_main_quit() here again?
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void uiMainSteps(void (*f)(void *), void *data)
|
||||||
|
{
|
||||||
|
struct mainStepsData d;
|
||||||
|
|
||||||
|
d.f = f;
|
||||||
|
d.data = data;
|
||||||
|
gdk_threads_add_idle(mainSteps, &d);
|
||||||
|
gtk_main();
|
||||||
|
}
|
||||||
|
|
||||||
int uiMainStep(int wait)
|
int uiMainStep(int wait)
|
||||||
{
|
{
|
||||||
gboolean block;
|
gboolean block;
|
||||||
|
|
Loading…
Reference in New Issue