diamondsandperls:
Remember that  Tk (and, as far as I understand, any GUI) is an event-driven system. Once program execution enters the  MainLoop() function, the only things that count are events:  Button presses, keypresses on the keyboard, mouse movements and button clicks, etc., etc. The keyboard keypresses that would normally be available via  STDIN are  MainLoop events. Keyboard keypresses can go to a  Text widget, an  Entry widget, etc., if the widget is in focus. Otherwise...
(Update: However, I think (without testingsee subsequent post) it should be possible to capture  STDIN data before the  MainLoop is entered provided the  Tk script is launched from the command line. If it is launched via an icon click, we're back in territory unfamiliar to me.)

I know how to re-direct  STDOUT and  STDERR so as to make functions like  print() and  printf() output to, e.g., a  Text box. I do not know how to do anything similar with  STDIN and I am not even sure it is meaningful to talk of doing such a thing (Update: from within the  MainLoop)!

Can you describe in greater detail what it is you hope to accomplish with your program? What is the nature of the data that  STDIN is supposed to provide?


In reply to Re^5: need a popup gui stdin by AnomalousMonk
in thread need a popup gui stdin by diamondsandperls

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.