dlw@bale.cis.ufl.edu (Dave Wilson) (04/20/91)
No, it's not that bad, but I am having trouble with the concepts. In particular, the main loop. I have created a meter class, and now I want them to respond both to events and to socket input. I could send the tray of objects a Handle message (for events), or set up a Dispatcher and send it a dispatch message for file & socket i/o, but how do I do both? Any pointers would be most appreciated. Interviews seems much more powerful than X widgets, but I know how to *use* the widgets! thanks, Dave Wilson true address: dlwilson@encore.com
linton@marktwain.rad.sgi.com (Mark Linton) (04/23/91)
In article <28102@uflorida.cis.ufl.EDU>, dlw@bale.cis.ufl.edu (Dave Wilson) writes: |> No, it's not that bad, but I am having trouble with the concepts. In |> particular, the main loop. I have created a meter class, and now I want |> them to respond both to events and to socket input. I could send the tray |> of objects a Handle message (for events), or set up a Dispatcher and send |> it a dispatch message for file & socket i/o, but how do I do both? Any |> pointers would be most appreciated. You need to register an input handler with the global dispatcher, something like Dispatcher::instance().link(fd, Dispatcher::ReadMask, handler) where handler is an IOHandler. World uses the IOCallback macro to generate a "callback" handler--an object consisting of a World* and World::func that calls world->*func. The function is called when input is ready on fd.