Re: [gtk-list] Re: Drawing application



>The code for reading the values given by the sensor was written in C, before i
>started on gtk.
>It just reads a value from a digital oscilloscope, through the PC serial port,
>and stores it in a float variable.
>Anyway, how do i set the function priority?
>Perhaps i should use GtkPlot, as suggested by Adrian Feiguin. Thanks,

I would bet that your code design is the problem. I imagine that you
have just a single thread in your program, and it is basically just
reading values from the serial port in a function that never returns
control to GTK. When you call GTK functions to draw things, they don't
actually have any effect until you allow the "main loop" of GTK to run
again. 

As someone else suggested, you should use gtk_input_add() to set up a
callback function to handle reading input from the serial port when
data is ready. See the GTK tutorial for info on doing this.

--p



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