Exercises
Add scroll bars to the terminal emulator on page 442. Make it allow for resizeable text widgets.
The terminal emulator is based on an ANSI terminal. Change the emulator so that it emulates a particular terminal that is not ANSI-conforming. This could be useful if you have to interact with a program or service that is hardwired for a terminal type. Make the emulator understand any type of terminal.
Write a version of the UNIX
scriptcommand that automatically strips out any character graphics as the output is logged to a file.Modify the
term_expectprocedure on page 453 so that it does not require Tk. Use a list of character strings to emulate a Tk text widget. Then try it with an array. Which is faster? Is this what you had expected?Expand on the previous exercise, by emulating multiple terminals. Provide “hotkeys” so that you can switch between different terminal sessions in a single keystroke.
Write a script for browsing through the archives of the
comp.lang.tclnewsgroup. Display the subjects in a scrollable window, allowing them to be ordered by date, subject, or author. Upon selection, download the posting and display it.Modify the script from the previous exercise so that postings may be saved locally or cached so that the script does not have to
ftpthem again if they are selected.Modify the
tkpasswdscript so that it rejects passwords containing fewer than two digits and two alphabetic characters, one uppercase and one lowercase. Use exercise 4 on page 160.The
tkpasswd ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access