alexxx has asked for the wisdom of the Perl Monks concerning the following question:

<penitentially bows his head in front of the monks> I have a question for you, my head is aching from banging on Tk/curses walls: how can I display info using curses characters screen handling, inside Tk widgets? Oh please share your wisdom...

Replies are listed 'Best First'.
Re: Tk AND curses, alltogether
by zentara (Cardinal) on Feb 07, 2006 at 12:40 UTC
    If you just want to run a curses app embedded in a Tk window, you should be able to do it by embedding an xterm with the -e option, to execute the curses app. That should take care of all the keys working in the curses app. See embedding xterm into a Tk app. In that script, if you change it to
    system("xterm -into $xtId -e /usr/bin/mc &");
    It will run midnight commander in the Tk window.

    If you are trying to mix Tk and Curses code, in the same window, it will be a tough thing to do. Actually it would be easier to define what the curses application is doing, then port it to Tk code.


    I'm not really a human, but I play one on earth. flash japh
      well, this one is ending right inside my bag of tricks... incredible! I'd never thought this could be so easy and painless (well, it's perl after all...) with a line like:
      xterm -into $xtId -fn $fontname -geometry 150x50+0+0 +sb -bg black -e ./xtermjob.pl &
      it doesnt even seem a xterm window, but a widget in its own right.
      Thanks!
      alessandro