[Tutor] How to print ALL contents of a scrolled Tkinter window?

boB Stepp robertvstepp at gmail.com
Fri Apr 17 15:26:38 CEST 2015


Solaris 10, Python 2.4.4

Thanks to earlier help from this list, I can now print a particular
Tkinter-generated window. But this will only print what is currently
viewable on the screen. In the case of scrolled information that is
currently outside the viewing area, it would be missed by such a print
(Using OS import command, as Peter demonstrated.). This type of print
functionality appears in everyday software products, but it is not
clear to me (Yet!) how to approach this problem. My initial thoughts
are along the lines of: 1) Determine how many rows of information
appear in the viewing area. 2) Determine how many total rows of
information exist to be printed. 3) Figure out how to programmatically
do a *manual* scroll to bring up the hidden scrolled information. 4)
Repeatedly apply the printing method. While I can probably make this
approach work (It *seems* conceptually simple.), I cannot help but
feel there is a much better way...

I intend to scour my available Tkinter documentation to see if there
are root window level and scrolled area commands that might suggest
another approach. And what I am doing now, seeking your collective
wisdom...

Thanks!

-- 
boB


More information about the Tutor mailing list