[Top][All Lists]

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

[Patch] Re: Impossibility of modifiable invisible fields

From: Leon Winter
Subject: [Patch] Re: Impossibility of modifiable invisible fields
Date: Fri, 31 Aug 2018 09:25:51 +0200
User-agent: Mutt/1.10.1 (2018-07-13)

Hi Thomas,

it is with humble regret I have to admit my failure regarding this issue as I
have in fact caused this problem when trying to fix it in the first place.
We discussed this topic in April:

I opted for (2) which caused this problem based on a mistaken assumption about
other terminal programs. Infact !O_PUBLIC should behave like (1) only not
displaying the change which was a lot easier than expected to achieve.
My initial fix (for behaviour 1) broke the input just for the benefit of a
cursor moving "too far".
I would pledge to revert my initial change and instead just holding back
rendering for !O_PUBLIC while still computing all the changes (like scrolling)
which would be in fact the suggested approach (1).
See attached patch. I would have liked best to give you a patch that looks
pretty and adheres to the code convention but I there seems to be mix of tabs
and spaces and I could not decide what is right or wrong :D

> 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
> b) O_PUBLIC isn't tested or demonstrated.
> With those documented, we can discuss changes starting from that.

I also looked into that:
!O_VISIBLE fields are also not selectable.
Before my "bad fix", !O_PUBLIC fields were able to receive input but displayed
the cursor incorrectly during input (because scrolling was not done).
After my "bad fix", !O_PUBLIC fields had a fixed cursor on the first position
and only allowed for input of one character regardless of the actual dimension
of field.
With the attached patch, !O_PUBLIC cursor movement will be correct like O_PUBLIC
but the content will be not be displayed. This is what the man page suggests
that *should* happen.


Attachment: ncurses-o_public-fix.patch
Description: Text Data

reply via email to

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