XLib Event Loop - My code entry point??
I'm working on a terminal/monitoring program that displays serial input stream using standard lib fopen() in a window. I used a file viewing program as the basis for my Xlib program. I have modifed it get its input from the serial port, instead of a file. Everything works fine, but now I need read lines of serial I/O continiously into a circular buffer and output it directly to a Region of the window until told to stop. It really nothing more than a terminal window.
For this discussion, I'm just focused on how do I keep reading serial input while the processing has moved into the event loop. The function call display_lines() does all of the work copying and clearing regions, and scrolling lines of data up or down in the window.
if (theEvent.xexpose.count == 0) display_lines();
break;
Q: Do I need to fork() a child process? If so, and where:confused:.
I've been looking for code eamples, but haven't found any so far. I looked at xterm source, but it was to complicated to follow.:confused:
Hope someone can guide me in the right direction. This is pure XLib programming. I will be glad to post code and expand on this more if needed.
jw
1 Attachment(s)
Xlib Event Loop - My code snippet
Okay, I give up on code tagging. I don't know what the deal is...? I had everything laid out correctly in this message and it won't let me submit.:mad:
It should be that simple... Oh well, just see the file.:cool: