<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 07/06/2010 21:26, Ken MacDonald wrote:
<blockquote
 cite="mid:AANLkTilNvBshq3rsf2eEZ2KVU66yBUSVbHDeaT7uL1Oa@mail.gmail.com"
 type="cite">Hi,<br>
I've got a whole stack of event handlers, assigned via the usual
something like....<br>
  <br>
my_button.Click += button_was_clicked<br>
  <br>
As it turns out, the initialization for the thing that has all these
handlers may need to be run several times, and it seems like I ended up
with multiple copies of the same event handler, and
"button_was_clicked()" now gets invoked multiple times for EACH time I
click my_button. It seems to be solved by just skipping the handler
assignment if I've already done it before, but it seems odd that the
same EH would be assigned and fired twice. </blockquote>
<br>
It would seem odder to me if you added an event handler multiple times
and it *wasn't* called. :-)<br>
<br>
The less programming languages read your mind and work out what they
*think* you meant the better. If you don't want an event handler
installed multiple times then don't add it multiple times...<br>
<br>
Michael Foord<br>
<br>
<blockquote
 cite="mid:AANLkTilNvBshq3rsf2eEZ2KVU66yBUSVbHDeaT7uL1Oa@mail.gmail.com"
 type="cite">Is this really what I'm seeing? I can see a case for
assigning multiple <b>different</b> EH's:<br>
  <br>
my_button.Click += event_handler_1<br>
my_button.Click += event_handler_2<br>
  <br>
but then this begs the question, is there a defined order in which the
EH's will fire? I looked thru multiple python/IronPython books and
googled, but came up empty on both questions..... Hopefully someone
here understands these things better than I do....<br>
Ken<br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a>
<a class="moz-txt-link-freetext" href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a>
  </pre>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.ironpythoninaction.com/">http://www.ironpythoninaction.com/</a>
<a class="moz-txt-link-freetext" href="http://www.voidspace.org.uk/blog">http://www.voidspace.org.uk/blog</a>

READ CAREFULLY. By accepting and reading this email you agree, on behalf of your employer, to release me from all obligations and waivers arising from any and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and acceptable use policies (&#8221;BOGUS AGREEMENTS&#8221;) that I have entered into with your employer, its partners, licensors, agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. You further represent that you have the authority to release me from any BOGUS AGREEMENTS on behalf of your employer.

</pre>
</body>
</html>