[comp.windows.x] hypertext highlighting behavior?

bob@odi.COM (Bob Miner) (07/12/90)

Suppose I've got a text editor and I want the text under the cursor to
highlight as the user moves the cursor within the text editor window,
WITHOUT the user having to first press a mouse button or keyboard key.

Is this possible?

Using InputOnly windows, one per highlightable piece of text, would be
one solution as I'd get enter and exit events as the cursor moved over
the text, although the locations of these windows would need to be
adjusted as the user scrolls and text edits, which makes it unattractive.

Another approach would be to somehow get mouse motion events within a
window without a mouse button or keyboard key being pressed.  Whenever
I've gotten mouse motion events in the past, they've always been preceded
by a mouse button down event, so I'm unsure if this can be done.

Are there other better ways to do this?

Thanks,

Bob Miner

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      OOOOOOO			    ~ Bob Miner
   OOOO     OOOO		    ~ Object Design, Inc.
  OOOOO     OOOOO		    ~ 1 New England Executive Park
  OOOOO     OOOOO 		    ~ Burlington, MA 01803   USA
   OOOO     OOOO		    ~ bob@odi.com or uunet!odi!bob
      OOOOOOO    bject Design Inc.  ~ voice: (617) 270-9797 FAX: (617) 270-3509
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   "From there to here, from here to there, funny things are everywhere."
								- Dr. Seuss
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

mouse@LARRY.MCRCIM.MCGILL.EDU (der Mouse) (07/14/90)

> Suppose I've got a text editor and I want the text under the cursor
> to highlight as the user moves the cursor within the text editor
> window, WITHOUT the user having to first press a mouse button or
> keyboard key.

> Is this possible?

Certainly.  There's no technical reason why it can't be done.

> Using InputOnly windows, one per highlightable piece of text, would
> be one solution [...].

> Another approach would be to somehow get mouse motion events within a
> window without a mouse button or keyboard key being pressed.
> Whenever I've gotten mouse motion events in the past, they've always
> been preceded by a mouse button down event, so I'm unsure if this can
> be done.

Certainly.  Just select for PointerMotionMask or PointerMotionHintMask.
You should get MotionNotify events.  (Don't try to use motion hints if
you're not quite sure what you're doing; make it work the other way
first.  Motion hint events are much better in many circumstances, but
can be confusing at first.)

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu