Re: GTK Serial I/O Questions



"T.L." <kj5xf worldnet att net> writes: 
a) How do you get text out of a multi-line text widget and
     out to the serial port on COM3?
b) How do you get incoming data from the serial port (COM3)
     displayed in a text widget?


There are plenty of serial port details I'm not familiar with. I would
guess you just open /dev/ttyS2. But you probably want to ask on a
mailing list that deals with Linux programming, this is not really a
GTK issue.

Once you figure out the port, you just call gtk_editable_get_chars()
to get text from the widget, and gtk_text_insert() or something like
that to put it in - see the reference docs or header file.

To know when there's data on the port, register an input callback with
g_io_add_watch().

Havoc




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