Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 307
  • Last Modified:

Simple Tcl/TK Script to Dump Contents of a File to a Text Widget

What I want to do would seem so simple, but since I'm new to Tcl/TK, I need a jump start from one of you folks. My question is this: how can I dump the contents of a file to a Text GUI?

Thanks!
0
pdouglas
Asked:
pdouglas
1 Solution
 
ahoffmannCommented:
pack [text .t -width 80];
set f [open "./file" r];
while {[gets $f l]>=0} {.t insert end "$l\n"}
0
 
pdouglasAuthor Commented:
Thanks, ahoffman.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now