close all
hax = gca;
hl = plot ([0 1], [1 0], 'r', 'linewidth', 10);
hp = patch;

function cb (h, ~, msg)
  fprintf (2, 'Callback %s executed\n', msg);
  fflush (2);
endfunction

set (hax, 'buttondownfcn', {@cb, 'Axes'});
set (hl, 'buttondownfcn', {@cb, 'Line'});
set (hp, 'buttondownfcn', {@cb, 'Patch'});
