andlabs / andlabs/libui

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

Đang mở
#147 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
custom main loops enhancement help wanted question
Ngôn ngữ chính
C
Star
10.9k
Fork
612
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.