function getTSPart_work2 (varargin)

LINES=get(gca,'Children');
[LINESm,LINESn]=size(LINES);
if LINESm>1
     for i=1:LINESm-1
         delete(LINES(i,1))
     end
end
X=get(LINES(LINESm,1),'XData');
Y=get(LINES(LINESm,1),'YData');

[mouseX,mouseY]=ginput(2);
[Xm,Xn]=size(X);
Min=abs(X(1,1)-mouseX(1,1));
indexMin1=1;
for i=2:Xn
    if abs(X(1,i)-mouseX(1,1))<Min
        Min=abs(X(1,i)-mouseX(1,1));
        indexMin1=i;
    end
end
Min=abs(X(1,1)-mouseX(2,1));
indexMin2=1;
for i=2:Xn
    if abs(X(1,i)-mouseX(2,1))<Min
        Min=abs(X(1,i)-mouseX(2,1));
        indexMin2=i;
    end
end

hold on
if indexMin1>indexMin2
    TEMP=indexMin1;
    indexMin1=indexMin2;
    indexMin2=TEMP;
end

%par=get(hObject,'Parent');
childs=get(gcf,'Children');
set(childs(length(childs)-3),'String',num2str(indexMin1));
set(childs(length(childs)-5),'String',num2str(indexMin2));
