Jeff,<div><br></div><div>Thanks a lot. It worked great for me as well.</div><div><br clear="all">Thanks,<br>Sathish<br>
<br><br><div class="gmail_quote">On Tue, Feb 22, 2011 at 10:28 PM, Jeff  Hobbs <span dir="ltr"><<a href="mailto:jeff.hobbs@gmail.com">jeff.hobbs@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On Feb 22, 8:48 am, Terry Reedy <<a href="mailto:tjre...@udel.edu">tjre...@udel.edu</a>> wrote:<br>
> On 2/22/2011 6:50 AM, Peter Otten wrote:<br>
><br>
</div><div class="im">> > import Tkinter as tk<br>
> > from itertools import cycle<br>
><br>
> > root = tk.Tk()<br>
> > text = tk.Text(root, font=("Helvetica", 70))<br>
> > text.pack()<br>
><br>
> > text.insert(tk.END, "Hello, geocities")<br>
> > text.tag_add("initial", "1.0", "1.1")<br>
> > text.tag_add("initial", "1.7", "1.8")<br>
><br>
> > colors = cycle("red yellow blue".split())<br>
> > initial_colors = cycle("#8f8 #f08".split())<br>
><br>
> > def switch_color():<br>
> >      # change the complete widget's background color<br>
> >      text["bg"] = next(colors)<br>
><br>
> >      # change the background color of tagged portions<br>
> >      # of the widget's conten<br>
> >      text.tag_config("initial", background=next(initial_colors))<br>
><br>
> >      # do it again after 300 milliseconds<br>
> >      root.after(300, switch_color)<br>
><br>
> > # call the color-setting function manually the first time<br>
> > switch_color()<br>
> > root.mainloop()<br>
><br>
</div><div class="im">> This example is helpful to me. I am curious though why the tk window<br>
> takes up the full screen instead of being much smaller as usual for<br>
> other examples I run. Shortening or shrinking the text has no effect.<br>
<br>
</div>Because a 70point Helvetica font was requested, and the text widget<br>
has a default size of 80x24.  That would occupy the full size of most<br>
screens.<br>
<font color="#888888"><br>
Jeff<br>
</font><div><div></div><div class="h5">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br></div>