Re: [Tutor] command in menu and button

2005-11-23 Thread Double Six
Hi John and Alan, I got it! Thank you both for explaining this situation. Thanks, Joe Get your own "800" number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag On Tue, 22 Nov 2005, [EMAIL PROTECTED] ([EMAIL PROTECTED]

Re: [Tutor] command in menu and button

2005-11-22 Thread alan . gauld
>>I'm puzzled by the 'command' option in menu and Button of >>Tkinter. With the following lines, The command value needs to be a *reference* to a function. That is not the function call itself but a reference to the function that will be \called. Let me illustrate the difference: def f(): print

[Tutor] command in menu and button

2005-11-22 Thread John Fouhy
Apologies to Double Six for getting this twice; I forgot to cc: tutor.. On 23/11/05, Double Six <[EMAIL PROTECTED]> wrote: > menu.add_command(label="Open Viewer", command=os.system("Open my > viewer &")) Hi Joe, This is a fairly common gotcha. Think about what happens when python executes a fun

[Tutor] command in menu and button

2005-11-22 Thread Double Six
Hi all, I'm puzzled by the 'command' option in menu and Button of Tkinter. With the following lines, menu.add_command(label="Open Viewer", command=os.system("Open my viewer &")) Button(toolbar, text='Open Viewer', command=os.system("Open my viewer &")).pack(side=LEFT) I wanted to open a g