Mercurial > repos > public > sbplib
annotate +draw/prompt_point.m @ 319:fc91e3a2d44a feature/beams
Cleaned d4_variable_6_min_boundary_points.
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Mon, 26 Sep 2016 08:52:03 +0200 |
parents | 48b6fb693025 |
children | 00eb5db89da5 |
rev | line source |
---|---|
0 | 1 function [p, button] = prompt_point(s,varargin) |
2 default_arg('s',[]) | |
3 | |
4 set(gcf,'Pointer','crosshair') | |
5 | |
6 if ~isempty(s) | |
7 fprintf(s,varargin{:}); | |
8 end | |
9 | |
10 a = gca; | |
11 | |
12 function get_point(src,event) | |
13 cp = a.CurrentPoint; | |
14 p = cp(1,1:2)'; | |
15 a.ButtonDownFcn = []; | |
16 end | |
17 | |
18 a.ButtonDownFcn = @get_point; | |
19 waitfor(a,'ButtonDownFcn', []) | |
20 | |
21 set(gcf,'Pointer','arrow') | |
22 | |
23 end |