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

Can i create a window using perl in which I can display a text .This has to be done in Unix . The window will be similar to a word window where after running the perl script it pops up and I can write some text into it or display some text into it . Also if I place my mouse cursor position on a web page can I display the text under the cursor in this window . I need this application running on Unix . Please suggest me something constructive so that it can help me in coding . Thankyou !

20030720 Edit by Corion: Changed title from 'Perl doubt'

Replies are listed 'Best First'.
Re: Display text in Unix window with Perl
by Zaxo (Archbishop) on Jul 19, 2003 at 18:27 UTC

    Sure, see the Tk module.

    After Compline,
    Zaxo

      I think you want the Text or Scrolled widget in Tk This ought to be close to something that will work. I am newbie but this works for me.
      use Tk; my $mw = MainWindow -> new(); my $text = $mw -> Scrolled("Text", -height => 45, -wrap => 'word') -> place (#whatever works); then you need these to add, delete and get text to window. $text -> insert('end', $whatever); $text -> delete("1.0",'end'); my $fetch_the_text = $text -> get("1.0","end");
      Should work Unix or Windows, and you can cut and paste from outside the Window.

      edited: Sat Jul 19 23:41:30 2003 by jeffa - code tags

        Doh, sorry for no formatting, :(