From: drscrypt on
Is there a way to ask a widget if the mouse is over it at that point in
time? (I am not asking about the focus or the many mouse bindings but
about the presence of the mouse cursor over the widget.)


DrS

From: Spam on


Try this ...

pack [button .b -text {A Widget}]
bind .b <Enter> {puts himom}


On Tue, 23 Mar 2010, drscrypt(a)gmail.com wrote:

> Date: Tue, 23 Mar 2010 15:28:20 -0400
> From: drscrypt(a)gmail.com
> Newsgroups: comp.lang.tcl
> Subject: Mouse over
>
> Is there a way to ask a widget if the mouse is over it at that point in time?
> (I am not asking about the focus or the many mouse bindings but about the
> presence of the mouse cursor over the widget.)
>
>
> DrS
>
>
From: Aric Bills on
On 23 mar, 13:28, drscr...(a)gmail.com wrote:
> Is there a way to ask a widget if the mouse is over it at that point in
> time?  (I am not asking about the focus or the many mouse bindings but
> about the presence of the mouse cursor over the widget.)
>
> DrS

There are at least two ways to do it. What exactly are you trying to
accomplish? If you want to check for mouse-overs for a specific
widget, you can create bindings for that widget to <Enter> and <Leave>
events. If you want to know which widget is under the mouse pointer
at a particular time, you can use [winfo containing ...] in
conjunction with data from another binding such as <Motion> or from
other [winfo] subcommands.
From: drscrypt on
On 3/23/2010 5:13 PM, Aric Bills wrote:
> There are at least two ways to do it. What exactly are you trying to
> accomplish? If you want to check for mouse-overs for a specific
> widget, you can create bindings for that widget to<Enter> and<Leave>
> events. If you want to know which widget is under the mouse pointer
> at a particular time, you can use [winfo containing ...] in
> conjunction with data from another binding such as<Motion> or from
> other [winfo] subcommands.


I have two synchronized listboxes that are deeply embedded in a widget
hierarchy but they display side to side. I would like the user to be
able to use their mouse wheels to scroll these without having to click
on them, which changes the selections they have made already.

I was hesitant to use Enter/Leave but if there is no other way, that is
an option. I will look into [winfo containing] command.


DrS


From: Aric Bills on
On 23 mar, 15:35, drscr...(a)gmail.com wrote:
> On 3/23/2010 5:13 PM, Aric Bills wrote:
>
> > There are at least two ways to do it.  What exactly are you trying to
> > accomplish?  If you want to check for mouse-overs for a specific
> > widget, you can create bindings for that widget to<Enter>  and<Leave>
> > events.  If you want to know which widget is under the mouse pointer
> > at a particular time, you can use [winfo containing ...] in
> > conjunction with data from another binding such as<Motion>  or from
> > other [winfo] subcommands.
>
> I have two synchronized listboxes that are deeply embedded in a widget
> hierarchy but they display side to side.  I would like the user to be
> able to use their mouse wheels to scroll these without having to click
> on them, which changes the selections they have made already.
>
> I was hesitant to use Enter/Leave but if there is no other way, that is
> an option. I will look into [winfo containing] command.
>
> DrS

I guess I don't understand the hesitation to use Enter/Leave. What
would be the problem?