Re: [PDCurses] cursor on white background is invisible (xcurses)

2010-12-07 Thread Bill J Gray

Hi John,

   I may have shot off my mouth too quickly.  My experience is mostly
with the DOS,  Windows,  and my own Win32a (Windows GUI) flavors of
PDCurses.  In these,  the cursor always just inverts colors,  and
blinks.  The only difference between curs_set(1) and curs_set(2)
is that the former causes the bottom line of the character cell to
blink,  whilst the latter causes the entire cell to blink.  (And
curs_set(0) shuts the cursor off.)

   SDL does the same thing,  except the cursor doesn't blink.

   Sounds as if XCurses fills the cursor block,  instead of inverting
it,  which would differ from the above cases.  (I only used XCurses
briefly,  some time ago.)  I'd think inversion would be greatly
preferable to filling.

-- Bill



Re: [PDCurses] cursor on white background is invisible (xcurses)

2010-12-07 Thread Mark Hessling
Would a blinking cursor help? If so, look in the documentation for the
X11 Resource: cursorBlinkRate. I set the cursor to blink every 1/2
second ( cursorBlinkRate: 500) in THE.

Cheers, Mark

On Tue, 2010-12-07 at 11:40 +0100, John P. Hartmann wrote:
> 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 
> Date: 7 December 2010 08:17
> Subject: Re: [PDCurses] cursor on white background is invisible (xcurses)
> To: Bill J Gray 
> Cc: [email protected]
> 
> 
> 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  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
> >

-- 

* Mark Hessling, [email protected] http://www.rexx.org/ 
* Author of THE, a Free XEDIT/KEDIT editor, Rexx/SQL, Rexx/CURL,  etc. 
* Maintainer of Regina Rexx interpreter and Rexx/Tk 
* Use Rexx? join the Rexx Language Association: http://www.rexxla.org/ 



[PDCurses] cursor on white background is invisible (xcurses)

2010-12-07 Thread John P. Hartmann
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 
Date: 7 December 2010 08:17
Subject: Re: [PDCurses] cursor on white background is invisible (xcurses)
To: Bill J Gray 
Cc: [email protected]


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  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
>


Re: [PDCurses] cursor on white background is invisible (xcurses)

2010-12-06 Thread John P. Hartmann
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  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
>


Re: [PDCurses] cursor on white background is invisible (xcurses)

2010-12-06 Thread Karl Garrison
curs_set(2)

On Mon, Dec 6, 2010 at 7:22 AM, John P. Hartmann  wrote:
> Hello,
>
> Forgive my ignorance.  How do I make the cursor reverse video?  I wish
> to ensure that it is always identifiable.  How do I select a different
> style?
>
> Thanks,
>
>   j.
>


Re: [PDCurses] cursor on white background is invisible (xcurses)

2010-12-06 Thread Warren Gray
If I understand your question correctly, you want to change your cursor. But
that
is hardwired into your terminal/emulator.  Curses cannot change the way your
cursor works.  Look for terminal or emulator settings for that.

Warren

On Mon, Dec 6, 2010 at 7:22 AM, John P. Hartmann wrote:

> Hello,
>
> Forgive my ignorance.  How do I make the cursor reverse video?  I wish
> to ensure that it is always identifiable.  How do I select a different
> style?
>
> Thanks,
>
>   j.
>


[PDCurses] cursor on white background is invisible (xcurses)

2010-12-06 Thread John P. Hartmann
Hello,

Forgive my ignorance.  How do I make the cursor reverse video?  I wish
to ensure that it is always identifiable.  How do I select a different
style?

Thanks,

   j.