>> First of all, this makefile is not building anything with debugging information (-g) so I'm guessing that you haven't run this under a debugger to inspect the
>> behavior at all. I'd encourage you to do that rather than relying too heavily on debugging-by-print-statements.
Since I have only taken and introduction to C++ class I never really learned how to use a debugger in general. Most languages I have taught myself or had a quick crash course in my engineering classes, as you have probably seen while looking at my code.
>> So I think there are a few issues mixed together here. When you register an io handler, it will use the default priority (G_PRIORITY_DEFAULT) unless
>> otherwise specified. This priority is apparently higher than the priority for re-drawing events (see [1]), so if there is io ready to be handled, it seems that it will
>> always take priority over the redraw (in your current code). Combine this with the fact that you're actually calling the read_line() function in your expose
>> handler rather than in your io handler, and what you have is Update() being called in a sort of an infinite loop with no data ever being read.
>> (as a side note, you're never checking the return value of your read_line() call, so even if your read_line() function was getting called as desired, you would
>> continue attempting to process data long after the end of file actually occurred).
>> I have hacked up a few changes to your code that gets things to a semi-working state, but it'll probably require a bit more work to get it working properly.
>> hopefully it's enough to give you some ideas though.
>> [1] http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#G-PRIORITY-HIGH-IDLE:CAPS