Re: A question about "event" signal of GtkTextTag



Hi.

I appreciate your kind suggestion, but that seems not to be the proper solution yet.

> Hi,
> 
> "Dongho Shin" <electman acadcorp com> writes:
> 
> > I connected "event" signal to GtkTextTag widget and examined the results, which were
> > somewhat odd for me.
> > The 'GDK_MOTION_NOTIFY' type event handler was called back only after
> > 'GDK_BUTTON_PRESS' or 'GDK_BUTTON_RELEASE' type event handler was.
> > That is, to catch a 'GDK_MOTION_NOTIFY' type event, I should press button on the tag first.
> 
> unless I'm wrong the GtkTextView widget sets this event_mask:
> 
>  (GDK_EXPOSURE_MASK            |
>   GDK_SCROLL_MASK              |
>   GDK_KEY_PRESS_MASK           |
>   GDK_BUTTON_PRESS_MASK        |
>   GDK_BUTTON_RELEASE_MASK      |
>   GDK_POINTER_MOTION_MASK      |
>   GDK_POINTER_MOTION_HINT_MASK |
>   GDK_STRUCTURE_MASK)
> 
> so it should be delivering motion events even if the mouse button is not
> pressed. Are you sure that your window is focused at all before you press
> a button in it? You might be tricking yourself with a click-to-focus WM
> policy.

For sure my window was focused when I move mouse pointer on it.
The strange thing is that if I connect "motion-notify-event" signal to my TextView,
the callback would be invoked only when the mouse pointer's entering the window
as if "enter-notify-event" case.
Similarly, the 'GDK_MOTION_NOTIFY' type event would be caught only after
I clicked the TextTag.
My vague reasoning for this phenomenon is that TextView might block
emissions of "motion-notify-event" after a certain operation.

> 
> > How can I change my code to get the 'GDK_MOTION_NOTIFY' event every time it happens
> > on GtkTextTag widgets? Is it possible?
> 
> did you try the following yet:
> 
>   gtk_widget_add_events (GTK_WIDGET (text_view), GDK_POINTER_MOTION_MASK);

I did that, but that seems not to be working.

My working platform is Solaris 2.6 / Sun Ultra Sparc 10. Can it be the source of my problem?

> 
> 
> Salut, Sven
> 

Thanks a lot.
Dongho.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]