Tkinter: How do I change the actual width of a widget?

Mudcat mnations at gmail.com
Sat Nov 11 00:35:25 CET 2006


I am trying to change the width of a widget based on pixel size and not
on characters. I can't figure out how to do this.

Normally to change to the size of a widget it looks like:

widget.configure(width = x)

However that is in characters, not in pixels. To retrieve the actual
size of a widget, I believe it is done with:

x = widget.winfo_width()

Obviously that value can not be used in the configure statement. Is
there a way to dynamically change the width (and height) of a widget
using the winfo data?

Thanks,
Marc




More information about the Python-list mailing list