>I understand this:
>>
>> def f(w): gtk.main_quit()
>> button.connect("clicked", f)
>>
>
> Now my question is what is "w"? What is being passed
> to the function?
That will be defined by GTk. The framework will define what
each of its event hamdler callback functions looks like in terms
of p
On 17/06/06, Christopher Spears <[EMAIL PROTECTED]> wrote:
> I understand this:
> >
> > def f(w): gtk.main_quit()
> > button.connect("clicked", f)
> >
> Now my question is what is "w"? What is being passed
> to the function?
I don't know GTK, but I would guess some kind of event class. Other
GUI
I understand this:
>
> def f(w): gtk.main_quit()
> button.connect("clicked", f)
>
> lambda simply saves cluttering up the code with lots
> of tiny function
> derfinitions which are never referred to apart from
> in the binding
> operation.
>
Now my question is what is "w"? What is being passe
>I have been reading though the PyGTK tutorial.
> Can anyone explain how lambda is being used in this
> statement:
>
> button.connect("clicked", lambda w: gtk.main_quit())
lambda is being used to create an anonymous function.
The code could be rewritten like this:
def f(w): gtk.main_quit()
butto
(resending to include Tutor -- sorry for the dupe, Christopher)
On 16/06/06, Christopher Spears <[EMAIL PROTECTED]> wrote:
> I have been reading though the PyGTK tutorial.
> Can anyone explain how lambda is being used in this
> statement:
>
> button.connect("clicked", lambda w: gtk.main_quit())