-
-
Notifications
You must be signed in to change notification settings - Fork 82
Question on IOChannel #385
Comments
Why would you want to read stdin in a GUI application? |
My use case is relatively specific. I want to create a status bar with the same interface as i3bar. Meaning that the output of the i3status command is piped to my application. The information is then read from the stdin and displayed accordingly. For displaying the information I use gtk-rs and webkit2gtk. EDIT: I probably could put out the information with a local webserver and view it with the webview. |
Reading from |
Maybe I am under the wrong impression, but I thought you can only read input with rusts facilities by adding your function as a callback via idle_add. With an IOChannel you would be able to add it to the event loop and you would get a callback only when there is input to read. |
Oh right, with the blocking API in |
Yeah that is exactly what I am doing right now. I start a seperate thread for reading input which is then send over a |
There's an issue that |
Thanks for the heads-up. Is there a reason you don't add the callback outside of the |
A perpetual |
Ah I understand now. Seeing this I think it would be a nice quality of live improvement if there is something like GIOChannel or a similiar solution. |
I was just revisiting this and wanted to implement your solution since it is obviously better, but I encountered the problem that I can't use this method when I want to read input while the gtk main loop is running since gtk may only be accessed from the main thread. This means I can not call Edit: Scratch that I was using |
@GuillaumeGomez Close this, it's a duplicate of https://github.com/gtk-rs/glib/issues/186 :) |
Add support for gsize/gssize by using usize/isize
I have a question: Is there a way to listen to stdin in the gtk main loop?
Are there any plans to port GIOChannel which is currently only available through glib_sys::GIOChannel?
The text was updated successfully, but these errors were encountered: