[comp.windows.x] how to make a line of text blink?

mouse@larry.mcrcim.mcgill.EDU (01/21/91)

> Does anybody know of a easy way to draw a line of text and make it
> blink, using XLIB?

Probably not.

> I have been looking through my XLIB manual and couldn't find a good
> way to do this seems-so-easy thing.  The only way I can think of is
> to just draw it repeatedly from my application, any better solution?

I don't think there is any, in general.  (Some extensions, like the
Display PostScript extension, may be able to do this.  You also might
be able to persuade the Multi-Buffering extension to do this somehow.
But I don't think it's possible within the core protocol.)  I do know
that when I wrote mterm, I wound up doing blinking the hard way - by
repeatedly redrawing the object that's supposed to blink.

					der Mouse

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

wht@n4hgf.Mt-Park.GA.US (Warren Tucker) (01/22/91)

> Does anybody know of a easy way to draw a line of text and make it
> blink, using XLIB?

One hack to to allocate a private color cell and use it to
write material to be blinked. Then use an application timeout
to alternate the contents of the cell between black and, say,
red. This is a hack, but it works.  The scheduling irregularity
of timeouts gives you irregular blinking, though.
 
-----------------------------------------------------------------------
Warren Tucker, March Hare   gatech!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
When bad men combine, the good must associate;  else they will fall one
by one, an unpitied sacrifice in a contemptible struggle. -Edmund Burke

tp@mccall.com (Terry Poot) (01/22/91)

In article <301@n4hgf.Mt-Park.GA.US>, wht@n4hgf.Mt-Park.GA.US (Warren
Tucker) writes:
>> Does anybody know of a easy way to draw a line of text and make it
>> blink, using XLIB?
>
>One hack to to allocate a private color cell and use it to
>write material to be blinked. Then use an application timeout
>to alternate the contents of the cell between black and, say,
>red. This is a hack, but it works.  The scheduling irregularity
>of timeouts gives you irregular blinking, though.

It also doesn't work so good on monochrome (static gray) systems.
--
Terry Poot <tp@mccall.com>                The McCall Pattern Company
(uucp: ...!rutgers!ksuvax1!mccall!tp)     615 McCall Road
(800)255-2762, in KS (913)776-4041        Manhattan, KS 66502, USA

guy@auspex.auspex.com (Guy Harris) (01/23/91)

>One hack to to allocate a private color cell and use it to
>write material to be blinked. Then use an application timeout
>to alternate the contents of the cell between black and, say,
>red. This is a hack, but it works.

Even on boring old monochrome "color"map-less machines like mine?

Remember, folks, not everybody in the universe has a color display on
their desk - and not everybody is hot to get one (I had a color display
on my desk for over a year; its main effect was to annoy me whenever it
started displaying menu cursors in red - I never actually *used* the
colors for anything except to run a worm-generator as a screen lock).

razdan@phx.mcd.mot.com (Anshuman Razdan) (01/24/91)

In article <301@n4hgf.Mt-Park.GA.US> wht@n4hgf.Mt-Park.GA.US (Warren Tucker) writes:


   > Does anybody know of a easy way to draw a line of text and make it
   > blink, using XLIB?

   One hack to to allocate a private color cell and use it to
   write material to be blinked. Then use an application timeout
   to alternate the contents of the cell between black and, say,
   red. This is a hack, but it works.  The scheduling irregularity
   of timeouts gives you irregular blinking, though.

   -----------------------------------------------------------------------
   Warren Tucker, March Hare   gatech!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US

------------------------- -------------------------

This would work if there is only one line of text. But if you
have a screen full of text, wouldn't it make all the text blink.
particularly when most of text widgets do not allow multiple
colors (i.e. only allow one for background and one for
foreground). May be I am missing something.
--

Anshuman Razdan

************************************************************
* razdan@toy			Test and Methodology Group *
*							   *
* razdan@phx.mcd.mot.com	Diablo Plant, Tempe  Az    *
************************************************************

andy@research.canon.oz.au (Andy Newman) (01/24/91)

In article <5435@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes:
>>One hack to to allocate a private color cell and use it to
>>write material to be blinked. Then use an application timeout
>>to alternate the contents of the cell between black and, say,
>>red. This is a hack, but it works.
>
>Even on boring old monochrome "color"map-less machines like mine?
>
>Remember, folks, not everybody in the universe has a color display on
>their desk - and not everybody is hot to get one (I had a color display
>on my desk for over a year; its main effect was to annoy me whenever it
>started displaying menu cursors in red - I never actually *used* the
>colors for anything except to run a worm-generator as a screen lock).

And even colour displays don't all have colour maps. A 24 bit
colour server probably wouldn't do it either.

-- 
Andrew Newman, Software Engineer.            | Net:   andy@research.canon.oz.au
Canon Information Systems Research Australia | Phone: +61 2 805 2914
P.O. Box 313 North Ryde, NSW, Australia 2113 | Fax:   +61 2 805 2929

bret@codonics.COM (Bret Orsburn) (01/25/91)

> Does anybody know of a easy way to draw a line of text and make it
> blink, using XLIB?

> I have been looking through my XLIB manual and couldn't find a good
> way to do this seems-so-easy thing.  The only way I can think of is
> to just draw it repeatedly from my application, any better solution?

It's only easy on conventional terminals with character generating hardware.
On such hardware, blinking is a relatively trivial boolean function, with
the terms being (1) an attribute bit [one per character] (2) a square wave
[at the blinking frequency]. When both of these terms is true, the video
output from the character generator is inverted (or modified in some other
way).

If you ponder this, you'll see that there is no analogous technique available
on a bitmapped display.

I once helped to design a bitmapped terminal which required a very complete
VT220 emulation. We ended up using an entire bit plane to control blinking
for arbitrarily sized bitmapped characters. We were able to enable or disable
blinking for each individual pixel! Effective, but costly.

Donald Knuth wrote a very interesting article on text processing a few years
back. In it he observed that when technologies change, we often spend a
considerable amount of time in the beginning trying to make the new
technology look and feel like the old technology. Eventually, we accept the
new technology as "correct", so that the cycle is repeated anew with the next
innovation.

Knuth was talking about printing technologies, but the observation easily
extends to other technologies. Blinking text is a good example of this.
The full screen crosshair cursor is another.

My advice is to skip the transition phase; come to terms with the new
technology. Don't dwell on a few lost landmarks, focus on the new
possibilities. Forge ahead!

(Finding someone who will *pay* you to Forge Ahead is a separate problem :-)
-- 
-------------------
bret@codonics.com
uunet!codonics!bret
Bret Orsburn

rhl@grendel.Princeton.EDU (Robert Lupton (the Good)) (01/25/91)

Well, I'm happy to use some other sort of highlighting instead of
blinking, but I can't agree about the full-screen crosshair. One of the
things that I miss in X is the ability to have such a cursor (yes, I
could make my own with XOR but...) --- very handy for graphics when you
want to know the coordinates of _that_ point, or put a horizontal line
just between _that_ pair for a monment. One of the few nice things about
SunView (and Tek 401?'s). 

				Robert

jkh@bambam.pcs.com (Jordan K. Hubbard) (02/01/91)

You can also use the termCanvas widget as distributed with emu.tar.Z.

It stands alone fine for displaying text in a variety of interesting
modes.

					Jordan
--
			PCS Computer Systeme GmbH, Munich, West Germany
	UUCP:		pyramid!pcsbst!jkh jkh@meepmeep.pcs.com
	EUNET:		unido!pcsbst!jkh
	ARPA:		jkh@violet.berkeley.edu or hubbard@decwrl.dec.com