Thanks for the input. I will keep it in mind for future dev. However, in
my case I only have 2 options that I need to uses so what I did was
Object1->OnHit to Func1
Object2->OnHit to Func2
def Func1(self,evt)
#call Func with True
self.Func(evt,True)
def Func2(self,evt)
#call Func with False
self.Func(evt,False)
def Func(self,evt,isTrue)
#code
if isTrue:
#code
else:
#code
Do you see anything wrond with doing it this way?
Thanks,
Larry Long
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Carl Karsten
Sent: Tuesday, June 05, 2007 11:41 AM
To: Dabo Users list
Subject: Re: [dabo-users] Binding events
Ed Leafe wrote:
> On Jun 5, 2007, at 10:24 AM, <[EMAIL PROTECTED]>
> <[EMAIL PROTECTED]> wrote:
>
>> When binding an event, is there a way to pass additional function
>> argument(s)?
From what I have gleamed in the last week, no.
>>
>> For example on, on one object I need to call boundFunction(True) and
>> on another I want to call boundFunction(False)
>
> Normally that would be managed by the event handler. Assuming that
> the object you would want True passed is referenced by
> 'self.TrueObject':
>
> def handler(self, evt):
> param = (evt.EventObject is self.TrueObject)
>
> At this point, if the event object is TrueObject, 'param' will be
> True; otherwise, False.
>
I am curious why you advise (or say "Normally") using the evt parameter over
using separate methods.
as in:
def handler(self, evt, myBool):
def handler1(self, evt):
handler(self, evt, True):
def handler2(self, evt):
handler(self, evt, False):
Carl K
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]