function addMenu(h,cdata)


for k=1:length(h.PointTips)
    if ~isempty(h.PointTips{k}) && ishandle(h.PointTips{k})
        uimenu('Parent',get(h.PointTips{k},'Uicontextmenu'),'Label','Remove event',...
           'Callback',{@localRemove h cdata});
    end
end

function localRemove(es,ed,h,cdata)

%% Removes selected event from time series
ind = find(cdata.Event==cdata.Event.Parent.Events);

%% Create transaction
T = tsguis.transaction;
recorder = tsguis.recorder;

%% Remove event
cdata.Event.Parent.Events(ind(1)) = [];

%% Store transaction
T.commit;
recorder.pushundo(T);
    
cdata.Event.Parent.send('datachange');