Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 GTK+ 编程的真正初学者,但我无法理解 g_source_new() 函数。
我想使用 GTK 事件处理我的套接字(当我的套接字可读/可写时的新事件,如使用 select)。
如果有人能送我上路,我完全迷路了......
PS:我不想使用 Gtk 的套接字管理/为 UI 创建一个新线程。
提前谢谢你!
GSource 的文档记录很差。你能做的最好的就是浏览源代码,看看定时器和空闲源是如何实现的。阅读 g_timer_add 和 g_idle_add 的代码。