[gtkmm] Glib::IOChannel



I've been working through the tutorial, and when I found that the Monitoring I/O page was out of date, I wanted to try and get the demo running anyway with a Glib::IOChannel.

This is what I think the logic should look like (called from within ExampleApp::ExampleApp):

Glib::RefPtr<Glib::IOChannel> ifile =
  Glib::IOChannel::create_from_file("testfifo", "r");
Glib::RefPtr<Glib::IOSource> isource = ifile->create_watch(Glib::IO_IN);
isource->connect(SigC::slot(*this, &ExampleApp::on_input_read));

I removed the code to create the fifo from the program itself, and created a working fifo ("cat" and "tail -f" check out), but if I run the program, on_input_read never gets called.

I've tried it with the created watch responding to everything, and it's not signalling an error, either. Have I missed something, or does Glib::IOChannel just not work?

--
Christopher Clark <clark compudata-systems com>
Pongidae, and proud of it.

  First they ignore you.  Then they laugh at you.  Then they fight you.
Then you win.
                                                               -- Ghandi




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