FXRuby addInput for general win32 eventrs

A

anderson

Hello,
I'd like to use addInput to detect events occuring in
another thread. Is there a way to take advantage of
MsgWaitForMultipleObjects() for things like event objects
and mutexes from FXRuby?
It looks like you can pass any HANDLE to the FOX C++ API
but FXRuby addInput expects Ruby IO objects. I don't know
MSWindows much.
Bob
 
A

anderson

What are the other librari(es) you're using with Ruby that would be the
source of the HANDLE that you would want to pass into addInput() as an
argument? If I can figure out what kind of object they're using (on the
Ruby side) to represent a Win32 HANDLE, I can probably work with those
too (he says, optimistically ;)

-- Lyle

Hello Lyle,
I wrote a Ruby extension that processes a serial port stream and
divides it up into messages using the SLIP protocol. I'd like to
trigger the FXRuby GUI to read the message buffer when a complete
frame has arrived and plot things using the beautiful FXRuby.
If I were a MSWindows programmer I would write a proper device driver
that looked like a file and just addInput on it but alas that is
beyond my MSWindows skills. I could just open the serial port in
Ruby but processing the protocol takes some overhead.
I could write a separate process and
addInput pipe but I don't know how processes work on W2k and I've
had occasional troubles with threads in forked child processes
hanging on to MSWindowy dll things (probably due to me).
I did see that there is PulseEvent(HANDLE event) in win32 that
I thought could be used to trigger FXRuby to run the Ruby level callback.

I'm open to any suggestion how FXRuby can process the messages as
they arrive.
Bob
 
A

anderson

Lyle Johnson said:
What are the other librari(es) you're using with Ruby that would be the

I wrote a Ruby extension that gathers serial port data into
messages. I'd like to pass the completed messages to the
FXRuby GUI for plotting.
I'm open to any ideas to get the data into FXRuby land.
Here were some alternatives I had consided
1. Write a proper device driver but I don't know MSWindows
2. Open the serial device in FXRuby but this seems inefficient
3. addInput pipe to separate process doing the serial protocol

I noticed that win32 has a PulseEvent(HANDLE event) which I
thought might be handy for triggering FXRuby to run the
callback routine to process the message. Any ideas or
suggestions are appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top