http://qs1969.pair.com?node_id=100844

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

Below is a snippit of code I found to display text in a Tk Window.
sub show_instr { my $mw = shift; my $tl = $mw->Toplevel(-title => 'TkSolitaire Instructions'); my $text = $tl->Scrolled('ROText', -scrollbars => 'e', -wrap => 'word', -width => 80, -height => 32, -font => $FONT, -setgrid => 1, )->pack(-expand => 1, -fill => 'both'); $text->tagConfigure('title', -font => '-*-Helvetica-Bold-R-Normal--*-190-*-*-*-*-*-*', ); # separate paragraphs with two newlines my $instr = <<'EOInstr'; This program is free software. You may distribute or modify it under the terms of the Artistic license that is distributed with the Perl Kit. The card images in the cards directory came from <URL:http://www.waste.org/~oxymoron/cards/> and are distributed under the terms of the GPL. The object of the game is to pick up all the cards. You start with yo +ur base card (centered at the bottom). You may pick up (by clicking) any uncovered card whose denomination is one away from the base card's denomination (the ace is adjacent to both the king and the deuce). Su +it does not matter. Attempting to illegally pick up a card (if the card +is covered or if the card's denomination is not adjacent to the base card +'s denomination) will result in a terminal bell. Once you pick up a card +, it becomes the new base card. If you there are no more cards to pick up, click the base card. This +is equivalent to pulling the next card from the bottom of the pile. When the pile is exhausted, a card will be placed face down at the base. T +he game is over when no more cards are left in the field or when the base is exhausted and no legal moves remain. There is an undo option that lets you undo your last pickup. You can' +t undo once you've flipped the next base card because that would give an unfair advantage. My good friends Susan, Sarah and Mackenzie taught me how to play this game. I instantly loved it. Thanks for all the fun guys! When I relized my mom would soon be 29 and holding (again), I decided +that I'd let Tk and Fisher-Yates do the layout and shuffling so she (my mom +) could try her hand at this version of Solitaire. Happy 29th Birthday Mom! :) EOInstr chomp $instr; # make the paragraphs into one long line $instr =~ s/\n(?!\n)/ /g; $text->insert('end', "TkSolitaire Instructions\n", 'title'); $text->insert('end', $instr); }

if I wanted the window body to be the contents of a text file what would I need to do? Sorry, for such a dumb question but I cant figure this out.

Edit Masem 2001-07-31 - Title change from "Tk perl"