Re: questions about GtkTextView (gtk2)



hi Havoc and all,

On Tue, 2002-03-19 at 01:56, Havoc Pennington wrote:

Wayne Schuller <k_wayne linuxpower org> writes:

Is there a way to catch a signal when the user has passed the mouse over
a word in the GtkTextView?

You can of course connect to motion events and just call
get_iter_at_location() or whatever it's called to see which word you
are on. You can also handle the "event" signal on a tag, if there's a
specific tag on the word.

I have tried the second suggestion above. 

In the API docs there is nothing explaining the meaning of the 'event'
signal of a tag. When is it supposed to be triggered?

For some reason I can I mostly only get tag event signals when I click
on a tag. I can also get an event signal from moving the mouse outside
the text view onto a word just inside the widget. 

But I need to generate an event just when the mouse passes over any
word. Just moving the pointer over a tag slowly does not seem to
generate a tag event signal.


I would like words to highlight (change color) when the user passes the
mouse over them. (plus some other stuff)...

Should be easy, just handle motion events (and enter/leave events)
and apply colored tags.

What widget produces motion events? What signal do I connect to?

I can see some possibly relevant signals for the GtkWidget widget
('event' and 'motion-notify-event') but none of the signals seem to be
explained anywhere in the (otherwise excellent) api docs. I don't
actually think the names of the signals themselves are self-explanatory.

thanks,
wayne





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