Wow! This one works... I simply flush an array per each enter pressed.. and capture the last line by your method..
However, could you explain a little more what magic is inside the Glib::Idle?... I don't even know where to find the documentation... @@"
Re^2: Can I capture string typING in STDIN without press enter?
Replies are listed 'Best First'.
Hi, see Glib MainLoop for the MainLoop documentation. Documentation is sparse, but essentially, it waits until the Glib eventloop is idle, before running the sub, so as not to interfere with it. It is seen used more when you try to use Glib or Gtk2 code from a thread. If you get into GUI's, you will often read about the thread safety of the GUI toolkit. Gtk2's thread safety is accomplished principally by only using Glib::Idle->add to access the main gui code from within the thread. Here are a couple of examples.
Thanks a lot for all the suggestions and examples. I am going start with your simpler example above first ( looks more familiar style and easier for me ) but see if I will spot some thread safe is needed for the real run... this is a really nice alternative resort! Thanks again, Cheers! =)