by Teknojnky » Thu Jan 24, 2008 12:20 pm
trixmoto wrote:The event is probably fired every time the menu appears (and thus the menu item is shown). I don't think you should be adding the menu item here, but if you really want to, you should check it doesn't already exist so that you only do it once, like this...
Well that is just the problem.. the menu is only shown once, but the event is fired 3 times...
trigger1 = left click (select node)
trigger2 & 3 = right click
if you right click the node without selecting it first, you still get 3 events triggered.
try it and see, create an event with a simple msgbox and then right click the tree and you will get the msgbox 3 times.
[quote="trixmoto"]The event is probably fired every time the menu appears (and thus the menu item is shown). I don't think you should be adding the menu item here, but if you really want to, you should check it doesn't already exist so that you only do it once, like this...[/quote]
Well that is just the problem.. the menu is only shown once, but the event is fired 3 times...
trigger1 = left click (select node)
trigger2 & 3 = right click
if you right click the node without selecting it first, you still get 3 events triggered.
try it and see, create an event with a simple msgbox and then right click the tree and you will get the msgbox 3 times.