Re: passing arguments from scale widget to function

2005-08-23 Thread m7b52000
Problem solved. use 'command = Calc' to call my Calc function but ignore the argument passed to it. Create a list with the following elements - a.get(), b.get() and c.get(). Every time a scale slider is moved, Calc will retrieve the current scale values and I can do with them whatever I want...

Re: passing arguments from scale widget to function

2005-08-22 Thread m7b52000
Matt Hammond wrote: >> A. Partial success with : command = Calc. A slider will now pass >> its argument to a function without problem. My Calc function however >> is expecting 3 arguments - 1 from each slider i.e moving any of the >> 3 sliders should cause a recalculation. I am now gettin

Re: passing arguments from scale widget to function

2005-08-22 Thread Matt Hammond
> A. Partial success with : command = Calc. A slider will now pass its > argument to a function without problem. My Calc function however is > expecting 3 arguments - 1 from each slider i.e moving any of the 3 > sliders should cause a recalculation. I am now getting the following > erro

Re: passing arguments from scale widget to function

2005-08-22 Thread m7b52000
Matt Hammond wrote: > On Mon, 22 Aug 2005 12:16:01 +0100, m7b52000 <[EMAIL PROTECTED]> > wrote: > >>> command = lambda : Calc(a.get()) > > >> I get the following message when I use lambda as above: >> >> TypeError: () takes no arguments (1 given) > > > Oops, forgot! The Scale widget outp

Re: passing arguments from scale widget to function

2005-08-22 Thread Matt Hammond
On Mon, 22 Aug 2005 12:16:01 +0100, m7b52000 <[EMAIL PROTECTED]> wrote: >> command = lambda : Calc(a.get()) > I get the following message when I use lambda as above: > > TypeError: () takes no arguments (1 given) Oops, forgot! The Scale widget outputs a single argument - the value of the

Re: passing arguments from scale widget to function

2005-08-22 Thread m7b52000
Matt Hammond wrote: > On Sun, 21 Aug 2005 08:09:55 +0100, m7b52000 > wrote: > >> It is proving most difficult in Python. How do I pass the .get() >> values to my calculating function? Do I use the command option for >> each slider? e.g command = Calc(a.get()). Obviously not cos it >> doesn

Re: passing arguments from scale widget to function

2005-08-22 Thread Matt Hammond
On Sun, 21 Aug 2005 08:09:55 +0100, m7b52000 wrote: > It is proving most difficult in Python. How do I pass the .get() values > to my calculating function? Do I use the command option for each slider? > e.g command = Calc(a.get()). Obviously not cos it doesn't work. It should work if you w

passing arguments from scale widget to function

2005-08-21 Thread m7b52000
Some time ago I wrote a little program in Tcl/Tk that took the values from 3 sliders and performed a calculation using these values. The calculation was of course automatically repeated each time a slider was moved. It is proving most difficult in Python. How do I pass the .get() values to my