Three questions about Tkinter

Arnal arnaud at tribu.ch
Thu May 1 08:40:35 EDT 2003


In b8on3n$8au$1 at news-reader13.wanadoo.fr,  "Eric Brunel"
<eric.brunel at pragmadev.com> wrote :

>> resize it on the fly (the width and height properties are measured in
>> characters and lines, not in pixels). My current workaround is to make the
>> window not resizable but it would be nice to do it.
> 
> I don't exactly understand what you're trying to do here. What's the problem?
> Can you post a piece of code showing it?

I have found an answer, thanks anyway.

> The most common way to do it is via a lambda function. If you don't know what
> it 
> is, look at:
> http://www.python.org/doc/current/tut/node6.html#SECTION006740000000000000000
> 
> Practically, you'd write what you want to do like follows:
> 
> MRecents.insert_command(0, label=GetFileName(file),
>                           accelerator=acc,
>                           command=lambda i=i: OpenRecent(i))
> 
> There are more sophisticated solutions but this one should be enough for you.

Indeed, at least for the begining.

> HTH

Thank you!





More information about the Python-list mailing list