Three questions about Tkinter

Arnal arnaud at tribu.ch
Wed Apr 30 09:42:52 EDT 2003


Hi,

I'm new at python programming (as well as english writing!), and I'm trying
to make a simple text editor.

I'm using Tkinter, but I've the following problems:

-I can't figure out how to use a printer to print under Windows.

-I use a "text" control (I dislike the "widget" term, sorry), but I can't
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've a sub menu for recents files. When I read in my pref file to list
every file paths stored in it, I would like to add them in the recents
submenu. I can't find how to do it. I tried, inside a "while" with the
variable i:

MRecents.insert_command(0,label=GetFileName(file),accelerator=acc,command=Op
enRecent(i))

MRecents.insert_command(0,label=GetFileName(file),accelerator=acc,command=Op
enRecent i)

(MRecents is a global variable representing my submenu, GetFileName is a
function, no special meaning in the problem,acc is defined). In the first
example, the OpenRecent function is called directly, that's the normal
behavior, and there is a syntax error in the second example.
How to define an array of menu items with all calling the same function with
a parameter?



Has someone any information on one of these problems? It would be great.
Thanks in advance.





More information about the Python-list mailing list