Multiple MouseEnter messages - crash
Posted: Sat Oct 07, 2017 5:04 pm
I have a group that comprises an image, two buttons and a field. I wish to have the two buttons and field hide when the mouse is not over the group. I have placed mouse enter and leave handlers in the group but have run into a problem. If the mouse happens to be over a control that is made visible it seems that multiple mouse enter messages are triggered. By multiple I mean enough to cause the recurse alert to be posted at a depth of 400000. Often this is enough to crash the IDE.
The dictionary implies that controls below other controls do not receive mouse enter/leave messages. It seems that a group does not "count" as a control from this point of view. I have attached a small stack that can be made to crash by running the mouse in and out through the bottom of the graphic group. Beware that if you try the stack that the visible property of other objects may be set to false when a crash occurs.
I do not understand why so many messages are being generated. I can understand that a message is generated when the mouse enters the group and that a second may be generated if the mouse is over a button or field that is made visible by the first message but where the many thousand other messages come from is a mystery. Is this a feature or is it a bug? Any thoughts?
The stack : best wishes
Simon K
The dictionary implies that controls below other controls do not receive mouse enter/leave messages. It seems that a group does not "count" as a control from this point of view. I have attached a small stack that can be made to crash by running the mouse in and out through the bottom of the graphic group. Beware that if you try the stack that the visible property of other objects may be set to false when a crash occurs.
I do not understand why so many messages are being generated. I can understand that a message is generated when the mouse enters the group and that a second may be generated if the mouse is over a button or field that is made visible by the first message but where the many thousand other messages come from is a mystery. Is this a feature or is it a bug? Any thoughts?
The stack : best wishes
Simon K