gtkmm : program without a main window



gtkmm seems to require a call to Gtk::Main::run.

I am coding a little gnuplot-like program. The main interface will be <<
text based >> using readline. My (probably very basic) question is how
to make a call to Gtk::Main::run and still be able to enter some command
interactively.

To make my question clearer, the following code does nothing because
Gtk::Main::run is blocking.

#include<iostream>
#include<cstdlib>
#include<limits>

#include<gtkmm.h>

int
main(int argc,
     char** argv)
{
  using namespace std;
  Gtk::Main kit(argc, argv);
  Gtk::Main::run(); //< This is blocking !
  std::string line;
  getline(cin,line);
  while(1){
    if(line=="plot"){
    //      doplot()
    }
    if(line=="quit"){
      exit(-1);
    }
    getline(cin,line);
  }
  return EXIT_SUCCESS;
}

I am seeking the most appropriate way to do this. Any help would be
appreciated.

Sincerely,

Helfer Thomas



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