Using ButtonDownFcn w/ mapshow() in GUI
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I'm just starting to experiment w/ the GUI capabilities of MATLAB. I'm building a simple GUI which will allow for the display and manipulation of geotiffs and shapefiles. For testing purposes I created a bare-bones GUI which includes an axes object and a pushbutton. The button does nothing more than simply call mapshow() on a geotiff and shapefile at this point, but I was happy to see them displayed properly in the axes object.
Now on to my question: the next thing I wanted to play with was displaying the easting and northing location underneath the mouse cursor when a mouse button is clicked. So, I used GUIDE to define a ButtonDownFcn callback for the axes object. In the code I query the current point and update a couple of static text objects.
However, this callback only gets hit when I click on the axes object prior to displaying the geotiff/shapefile via mapshow(). Before calling mapshow() the callback works as expected. Once I call mapshow() the callback does not get called when I click over the image.
What is the proper way to specify callbacks when using mapshow()? Or is there a more appropriate way altogether to use mapshow capabilities within a MATLAB GUI?
Thanks!
-- Dan
댓글 수: 0
채택된 답변
Walter Roberson
2011년 6월 29일
mapshow() is creating an object on the axes, and the callback for that function has priority.
Try
h = mapshow(...);
set(findobj(h),'HitTest','off');
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!