{"action":"created","issue":{"url":"https://api.github.com/repos/andlabs/libui/issues/95","repository_url":"https://api.github.com/repos/andlabs/libui","labels_url":"https://api.github.com/repos/andlabs/libui/issues/95/labels{/name}","comments_url":"https://api.github.com/repos/andlabs/libui/issues/95/comments","events_url":"https://api.github.com/repos/andlabs/libui/issues/95/events","html_url":"https://github.com/andlabs/libui/issues/95","id":158136180,"number":95,"title":"uiMainStep does not work with gtk backend","user":{"login":"gnarz","id":11943627,"avatar_url":"https://avatars.githubusercontent.com/u/11943627?v=3","gravatar_id":"","url":"https://api.github.com/users/gnarz","html_url":"https://github.com/gnarz","followers_url":"https://api.github.com/users/gnarz/followers","following_url":"https://api.github.com/users/gnarz/following{/other_user}","gists_url":"https://api.github.com/users/gnarz/gists{/gist_id}","starred_url":"https://api.github.com/users/gnarz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnarz/subscriptions","organizations_url":"https://api.github.com/users/gnarz/orgs","repos_url":"https://api.github.com/users/gnarz/repos","events_url":"https://api.github.com/users/gnarz/events{/privacy}","received_events_url":"https://api.github.com/users/gnarz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-06-02T13:06:59Z","updated_at":"2016-06-10T14:48:46Z","closed_at":null,"body":"it always returns false. Some investigation shows that this is because the function gtk_main_iteration_do(), which is used to implement this, needs a running main loop, and that is only created when calling gtk_main() (see https://git.gnome.org/browse/gtk+/tree/gtk/gtkmain.c?h=3.18.9). So i see no easy way to fix this... maybe an idle callback would be a prudent replacement, that should be available on all platforms..."},"comment":{"url":"https://api.github.com/repos/andlabs/libui/issues/comments/225203055","html_url":"https://github.com/andlabs/libui/issues/95#issuecomment-225203055","issue_url":"https://api.github.com/repos/andlabs/libui/issues/95","id":225203055,"user":{"login":"andlabs","id":718242,"avatar_url":"https://avatars.githubusercontent.com/u/718242?v=3","gravatar_id":"","url":"https://api.github.com/users/andlabs","html_url":"https://github.com/andlabs","followers_url":"https://api.github.com/users/andlabs/followers","following_url":"https://api.github.com/users/andlabs/following{/other_user}","gists_url":"https://api.github.com/users/andlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/andlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andlabs/subscriptions","organizations_url":"https://api.github.com/users/andlabs/orgs","repos_url":"https://api.github.com/users/andlabs/repos","events_url":"https://api.github.com/users/andlabs/events{/privacy}","received_events_url":"https://api.github.com/users/andlabs/received_events","type":"User","site_admin":false},"created_at":"2016-06-10T14:48:46Z","updated_at":"2016-06-10T14:48:46Z","body":"`uiQueueMain()` is one-shot, but you don't have to return. What I was suggesting was something like\r\n\r\n```\r\nvoid queued(void *data)\r\n{\r\n    while (uiMainStep(0)) {\r\n        /* do your stuff here */\r\n    }\r\n}\r\n```\r\n\r\nand simply don't let the main loop run at all.\r\n\r\n`dispatch_get_main_queue()` is the magic, yes. OS X doesn't allow you to do GUI stuff across threads, so if `dispatch_async()` didn't honor the queue thread, it wouldn't be useful. See also `dispatch_after()`."}}
{"actor":{"display_login":"andlabs"}}