view +draw/prompt_point.m @ 1344:b4e5e45bd239 feature/D2_boundary_opt

Remove round off zeros from D2Nonequidistant operators
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Sat, 15 Oct 2022 15:48:20 +0200
parents 00eb5db89da5
children
line wrap: on
line source

function [p, button] = prompt_point(s, varargin)
    default_arg('s',[])

    set(gcf,'Pointer','crosshair')

    if ~isempty(s)
        fprintf(s, varargin{:});
    end

    fh = gcf();
    ah = gca();

    function get_point(src, event)
        cp = ah.CurrentPoint;
        p = cp(1,1:2)';
        fh.WindowButtonUpFcn = [];
    end

    fh.WindowButtonUpFcn = @get_point;
    waitfor(fh,'WindowButtonUpFcn', [])

    set(gcf,'Pointer','arrow')

end