How to update a GTK GUI on file creation?

时间:2017-12-18 07:43:32

标签: c process gtk fork

I am trying to create a simple GTK application. I would like to write things on the GUI as soon as certain files are created by different processes. I guess I cannot do a class UserController < AdminController ... user = abc(params) ... end in the parent process, because that would freeze the GUI. Instead, I am trying to fork, check if files are present and manipulate the GUI, but it does not seem to work, my clumsy code is the following:

while(true)

1 个答案:

答案 0 :(得分:3)

如果要执行I / O操作,请查看集成到GLib的gio。因此,您应该使用GFileMonitor使用inotify来通知文件系统更改。 &#34;描述&#34; GFileMonitor部分介绍了要使用的功能。