bug-ncurses
[Top][All Lists]
Advanced

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

Re: Impossibility of modifiable invisible fields


From: Thomas Dickey
Subject: Re: Impossibility of modifiable invisible fields
Date: Sat, 11 Aug 2018 11:33:00 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Aug 08, 2018 at 10:58:32AM +0200, Leon Winter wrote:
> Hi Thomas,
> 
> it seems currently in the ncurses/forms library it is impossible to have a 
> field
> which one can normally edit but it being invisible.
> Two options are currently available which impacts the visibility of a field:
> O_PUBLIC und O_VISIBLE. Until now we have chosen !O_PUBLIC which is fine in
> terms of focussability and hidden display but not when in comes to input: The
> cursor is not advanced, therefore only one character can be inserted (which at
> least is hidden). Naively switching to !O_VISIBLE made things worse as the 
> field
> cannot be focussed anymore. Digging into the sources yielded that O_SELECTABLE
> requires both O_ACTIVE as well as O_VISIBLE. Thus by design it is not possible
> to focus invisible fields.
> Needless to say we want focussable, editable, invisible fields and I am now
> wondering what the best approach would be. I assume O_SELECTABLE is currently
> chosen as it is as certain places in the source code can then assume the field
> is visible. I could look into that and might come up with yet another custom
> field option to make visible fields selectable. I definitely think O_VISIBLE 
> is
> the way to go (over O_PUBLIC).

Actually the manual page is vague.  It says:

       O_ACTIVE
            The  field  is  visited during processing.  If this option is off,
            the field will not be reachable by navigation keys.  Please notice
            that an invisible field appears to be inactive also.
...
       O_PUBLIC
            The field contents are displayed as data is entered.
...
       O_VISIBLE
            The  field  is  displayed.   If this option is off, display of the
            field is suppressed.

I think the best approach is to first clarify in the documentation
what the library actually does (and add test-cases which use both
features):

a) O_SELECTABLE is an example from the test-program demo_forms.c
   (not actually part of the library), but as noted, it combines
   O_ACTIVE and O_VISIBLE.

b) O_PUBLIC isn't tested or demonstrated.

With those documented, we can discuss changes starting from that.

-- 
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]