Path: news.mathworks.com!not-for-mail
From: "jay vaughan" <jvaughan5.nospam@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: ButtonPressFcn behaves strangely
Date: Tue, 13 May 2008 17:13:03 +0000 (UTC)
Organization: harvard
Lines: 66
Message-ID: <g0ci6v$8ti$1@fred.mathworks.com>
References: <g0ch73$79t$1@fred.mathworks.com>
Reply-To: "jay vaughan" <jvaughan5.nospam@gmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210698783 9138 172.30.248.37 (13 May 2008 17:13:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 13 May 2008 17:13:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1215048
Xref: news.mathworks.com comp.soft-sys.matlab:468203


"jay vaughan" <jvaughan5.nospam@gmail.com> wrote in message
<g0ch73$79t$1@fred.mathworks.com>...
> Hi,
> 
> I am running a GUI with an axes in it. When I start the GUI
> the axes are empty. During this time I am able to click on
> the figure and return a (diagnostic) message. I did the same
> for the GUI itself, and both work.
> 
> % --- Executes on mouse press over axes background.
> function axes1_ButtonDownFcn(hObject, eventdata, handles)
> disp('mouse button pressed on axes1');
> 
> 
> % --- Executes on mouse press over figure background.
> function figure1_ButtonDownFcn(hObject, eventdata, handles)
> disp('mouse button pressed on figure1');
> 
> But once I use image(frame) to display a frame in the axes,
> axes1_ButtonDownFcn can not be called anymore by mouse
> clicks on the axes, although figure1_ButtonDownFcn still can
> get called by mouse clicks on the figure background. This
> puzzles me quite a bit. Any ideas how I could fix this so
> that ButtonDownFcn continues to work after image(frame)?
> 
> Thanks,
> J


"jay vaughan" <jvaughan5.nospam@gmail.com> wrote in message
<g0ch73$79t$1@fred.mathworks.com>...
> Hi,
> 
> I am running a GUI with an axes in it. When I start the GUI
> the axes are empty. During this time I am able to click on
> the figure and return a (diagnostic) message. I did the same
> for the GUI itself, and both work.
> 
> % --- Executes on mouse press over axes background.
> function axes1_ButtonDownFcn(hObject, eventdata, handles)
> disp('mouse button pressed on axes1');
> 
> 
> % --- Executes on mouse press over figure background.
> function figure1_ButtonDownFcn(hObject, eventdata, handles)
> disp('mouse button pressed on figure1');
> 
> But once I use image(frame) to display a frame in the axes,
> axes1_ButtonDownFcn can not be called anymore by mouse
> clicks on the axes, although figure1_ButtonDownFcn still can
> get called by mouse clicks on the figure background. This
> puzzles me quite a bit. Any ideas how I could fix this so
> that ButtonDownFcn continues to work after image(frame)?
> 
> Thanks,
> J

Sorry for the quick reply...I wanted to add that mouse
clicks at the very edge of the axes do call
axes1_ButtonDownFcn, but not mouse clicks in the interior.
If it is helpful, I am also using a function to return mouse
position, although disabling this function (i.e. removing
the WindowButtonMotionFcn callback) did not restore the
mouse clicks in the interior of the axes after image(frame).

J