Maybe I should offer some background:  I'm writing a tn3270 client and
now converting from ncurses to XCurses because I could not get the
shift state in ncurses.

Reason is I've been using IBM's PCOM ever since my real 3270s were
scrapped because their controller was not year 2k compliant.  I'm now
using Fedor13 instead of windows, so PCOM is no longer an option (and
vmplayer/xorg expose bugs that make this combination a non-starter).

In the 3270 world, a field has a foreground colour and highlighting
attributes, among which is reverse video.  These highlight attributes
are mapped directly to the curses attributes.  Thus, the white reverse
is a colour pair of (white, black) and the reverse video attribute.

It looks like my default cursor is a solid white block that obscures
the lower half of the character cell, irrespective of the foreground
colour.

In testcurs, the colour is white on blue and the cursor is yellow,
which seems to indicate that the cursor is the reverse colour of the
background irrespective of reverse video.  With XCurses I can have an
additional eight colour pairs to cater for reverse video so that the
cursor is always visible.

I'm doing 3270, by the way.

Looking at the demo, I realise that the cursor colour is the reverse
of the background colour in the colour pair, but ignoring the reverse
video attribute (maybe the code should be fixed to take the reverse
attribute into account?).

Anyway, I changed the implementation of 3270 reverse video to select a
colour pair that is the reverse of the foreground colour.

My only remaining gripe (in this department, at least) is that the
half-size cursor obscures the lower half of the character.  The full
cursor does reverse video, presumably because nobody would wear seeing
a completely obscured character.

Is there any reason curs_set(1) could not work the same way as
curs_set(2)?  To my untrained eye it would appear that doing the same
thing, but only for half the height would simplify the code in
_display_cursor in x11.c.  Is this correct?

   j.




---------- Forwarded message ----------
From: John P. Hartmann <jphartm...@gmail.com>
Date: 7 December 2010 08:17
Subject: Re: [PDCurses] cursor on white background is invisible (xcurses)
To: Bill J Gray <pl...@projectpluto.com>
Cc: pdcurses-l@lightlink.com


If I understand you correctly, curs_set() alters the bitmap used for
the cursor, but not its colour.  So whether it is 1 or 2, it will
still be invisible when put on a blank painted on a white background.
Is that correct?

  j.

On 6 December 2010 16:04, Bill J Gray <pl...@projectpluto.com> wrote:
> Hi Warren,  John,
>
>> But that is hardwired into your terminal/emulator.  Curses cannot change
>> the way your cursor works.
>
>   Under XCurses,  it _could_,  because it's not a "for-real" terminal;
> it's a GUI window.  I've been working on a Windows GUI flavor of PDCurses
> which allows for blinking cursors and such.
>
>   But as presently implemented,  I'm reasonably sure that you can have
> three types of cursors:  an underscore,  a solid reversed block,  or no
> cursor at all.  These are all set using the curs_set() function.  (Pause
> to rummage through docs...)
>
>   curs_set() alters the appearance of the text cursor. A value of
>   0 for visibility makes the cursor disappear; a value of 1 makes
>   the cursor appear "normal" (usually an underline) and 2 makes
>   the cursor "highly visible" (usually a block).
>
>   Hope that's what you're looking for.  The alternative would be to
> fix up XCurses to allow for some more flexibility here.  Which would be
> a wonderful solution,  and I may even tackle that problem myself,  but
> it's not a short-term kind of solution.
>
> -- Bill
>

Reply via email to