[Tkinter-discuss] python: Display the text on tk window.

Michael Lange klappnase at web.de
Thu Jul 18 20:13:04 CEST 2013

On Thu, 18 Jul 2013 17:50:47 +0530
Srinivas Rao <srinivas.rambha at gmail.com> wrote:

> its working sir, thanks a lot.
> I had 1 more  issues.
> Is it possible to print this received text at the middle of the tk
> window irrespective of the data si.
> My question is @
> The receiver don't know the size of the receving data, but in my
> project i am sure that maximum 7 lines of data will receive.
> The font i choose is 37 in my code.with this font size i can print 9
> lines on the TK window. if i receive 1 line of data,this data should
> print on 5th line, by leaving equal amount of space at top and bottom
> of the window.Again i may receive 3 line of serial data, this data
> should print from 4th to 6th line of the window by leaving equal space
> on top and bottom.Again if i receive 6 lines of serial data, this
> should print from 2nd line to 7th line on the window. Irrespective of
> data size which is receiving, data should print on window by leaving
> equal amount of spaces at top and bottom of the window. This display
> will make a good impression to see on the window.

If you only want to display a limited amount of text and not edit this
text, maybe the Label widget would suit you better and the kind of
centered text you describe is the Label's default behavior.



.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

Immortality consists largely of boredom.
		-- Zefrem Cochrane, "Metamorphosis", stardate 3219.8

More information about the Tkinter-discuss mailing list