Sockets and GTK 1.1.x



I am writing a program for a CS class and we were given a socket source
file to work with.  It opens a socket and would normally be used for
terminal applications (it is extra credit to be using GTK).  Thus, since
it should be used for terminal, it blocks.  I don't think they would like
it very much if I rewrote the network interface (and I don't know if I
would be able to do it).  Now, the problem is that when I click on a
button in GTK, the program goes into receive mode, so it is in an infinite
loop as it is blocking.  However, the commands that I call to update the
button (there is a pixmap on it, and I would like to change it when it is
pressed) and the statusbar before I call receive do not get processed
until after the receive function has returned.  I have read through GTK
documentation on the web and tried gtk_widget_draw(), but this had no
effect.  Do I need to send an "expose" event to the button and statusbar??  
If so, where can I find information about how to do that (I couldn't find
it in documentation on web)??

Is there an easy way to solve the entire networking problem using
signal-based sockets that is relatively easy to implement (either using
GTK or some other thing, such as SIGIO) that anyone knows of??

Thank you for any help that you can provide.
Mike Lindahl
mlindahl@princeton.edu



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]