Jeremy White wrote:
I haven't tried this yet, but it seems wrong. Can you raise a bug report and I'll dig further into this one.

http://sourceforge.net/tracker/?func=detail&atid=116572&aid=1333060&group_id=16572 Ok - it seems this is only an issue when SetEvent is used (see example below, also on tracker).

Ah. I'd expect this. When you create the control, as you don't have any NEM handlers set Win32::GUI chooses to use OEM. When you use $control->SetEvent() it sets the NEM flag, so you end up with both happening.

You can work round this by:
(1) using -eventmodel => 'byref' in the constructor. This explicitly forces NEM only. (2) by setting any -onEvent => $someref option in the constructor. Again this will force NEM only. (e.g. for your example -onClick => sub { return; } would be suitable)

Question: is this a bug? The only alternate behaviour I can come up with is that SetEvent(), rather than setting the NEM flag, should check it and bail out if it is not set (with a warning?). [The current behaviour is useful if you are sub-classing a control, and do not know which method a user of the control will want to use.]

My vote is to leave it as is.

Regards,
Rob.


Reply via email to