Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
mouse hover event

Subject: mouse hover event

From: Yoav Rubin

Date: 2 Nov, 2007 16:55:15

Message: 1 of 8

Hi All,

Is there a mouse hover event for figure or axis?

thanks

Yoav

Subject: mouse hover event

From: us

Date: 2 Nov, 2007 17:23:32

Message: 2 of 8

Yoav Rubin:
<SNIP flying ML...

> Is there a mouse hover event for figure or axis?

a hint:

     set(gcf,'windowbuttonmotionfcn',your_callback);

% will do
% look at the docs for in-depth information

us

Subject: mouse hover event

From: Yoav Rubin

Date: 2 Nov, 2007 17:49:29

Message: 3 of 8

"us " <us@neurol.unizh.ch> wrote in message
<fgfmek$b99$1@fred.mathworks.com>...
> Yoav Rubin:
> <SNIP flying ML...
>
> > Is there a mouse hover event for figure or axis?
>
> a hint:
>
> set(gcf,'windowbuttonmotionfcn',your_callback);
>
> % will do
> % look at the docs for in-depth information
>
> us

Isn't this function called on any mouse move over the
figure, rather then on mouse hover?

thanks

Yoav

Subject: mouse hover event

From: Yair Altman

Date: 3 Nov, 2007 16:27:25

Message: 4 of 8

> > > Is there a mouse hover event for figure or axis?
> >
> > set(gcf,'windowbuttonmotionfcn',your_callback);
>
> Isn't this function called on any mouse move over the
> figure, rather then on mouse hover?


True, but within your_callback you can prime a timer that
fires your_hover_function after the specified hover period.

There is no specific hover event or callback.

Yair Altman
http://ymasoftware.com

Subject: mouse hover event

From: Yoav Rubin

Date: 4 Nov, 2007 16:49:44

Message: 5 of 8

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message
<fgi7hd$8bl$1@fred.mathworks.com>...
> > > > Is there a mouse hover event for figure or axis?
> > >
> > > set(gcf,'windowbuttonmotionfcn',your_callback);
> >
> > Isn't this function called on any mouse move over the
> > figure, rather then on mouse hover?
>
>
> True, but within your_callback you can prime a timer that
> fires your_hover_function after the specified hover period.
>
> There is no specific hover event or callback.
>
> Yair Altman
> http://ymasoftware.com

Do you mean to start a timer for every mouse move event and
after the timer period ends to check whether the mouse is in
the same location? this sounds not really efficient...

Thanks
Yoav

Subject: mouse hover event

From: Yair Altman

Date: 4 Nov, 2007 18:12:30

Message: 6 of 8

> Do you mean to start a timer for every mouse move event and
> after the timer period ends to check whether the mouse is in
> the same location? this sounds not really efficient...
>
> Thanks
> Yoav


No - you can use a single (persistent) timer object and
simply reset it upon every mouse move callback. The timer
will not be reset if the mouse does not move (=hover) and so
after several seconds of mouse non-movement, the timer
callback function will fire.

Yair Altman

Subject: mouse hover event

From: Yoav Rubin

Date: 5 Nov, 2007 05:36:37

Message: 7 of 8

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message
<fgl22e$8sh$1@fred.mathworks.com>...
> > Do you mean to start a timer for every mouse move event and
> > after the timer period ends to check whether the mouse is in
> > the same location? this sounds not really efficient...
> >
> > Thanks
> > Yoav
>
>
> No - you can use a single (persistent) timer object and
> simply reset it upon every mouse move callback. The timer
> will not be reset if the mouse does not move (=hover) and so
> after several seconds of mouse non-movement, the timer
> callback function will fire.
>
> Yair Altman
Thanks Yair, this is the solution I needed

Subject: mouse hover event

From: Toby

Date: 26 Feb, 2008 19:28:32

Message: 8 of 8

There is a mouse-over for the more recent versions of Matlab: look up the uicontrol property 'TooltipString'.
For example: >>set(gco,'TooltipString','This is an unhelpful popup help message')
would give the current object the indicated message.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us