andlabs / andlabs/libui

possibility: make it unnecessary to pass a function pointer into uiMainSteps()

未关闭
#147 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
custom main loops enhancement help wanted question
主要语言
C
星标
10.9k
派生
612
PR 合并指标
30 天内没有已合并 PR

描述

split from #95

Actually looking at the GTK+ source code again, I wonder what would happen if I did this

``` diff
diff --git a/unix/main.c b/unix/main.c
index bfd0544..0269d86 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -41,7 +41,8 @@ int uiMainStep(int wait)
block = FALSE;
if (wait)
block = TRUE;
- return gtk_main_iteration_do(block) == FALSE;
+ gtk_main_iteration_do(block);
+ return 1;
}

// gtk_main_quit() may run immediately, or it may wait for other pending events; "it depends" (thanks mclasen in irc.gimp.net/#gtk+)
```

and ran `uiMainStep()` without `uiMainSteps()`. @gnarz? I could also try this myself I guess... but if this does work I could probably just manage the running flag myself like I do on OS X and avoid the need for a function pointer.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。