bug-ncurses
[Top][All Lists]
Advanced

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

Re: Ncurses/Forms unfocus current field


From: Leon Winter
Subject: Re: Ncurses/Forms unfocus current field
Date: Mon, 17 Oct 2016 09:42:53 +0200
User-agent: NeoMutt/20160916 (1.7.0)

Hi Thomas,

> hmm - that's hard: there's no mode to say when this feature should be
> valid (as opposed to being a potential error).
> 
> I'm thinking in terms of compatibility, wondering what could break(?)

if we were to introduce a new function like "onfocus_current_field" or
"unset_current_field" nobody could unfocus a field by accident (i.e. supplying a
NULL-ptr field to set_current_field). In terms of API this should not break
anything and is fully backward-compatible. Only new code would use the new API.
Considering the internals, functions need be adapted to consider a case of "no
field is focused". Maybe even some applications access the current_field pointer
directly without the API. All of these applications could break, however only if
they request an unfocus of the current field with the new API.
One could even go one step further and instead of internally setting the field
pointer to NULL use another flag "no_focus". This way the field pointer is
always a valid field (even though the flag "no_focus" indicates that it is
actually not in focus).

Regards,
Leon



reply via email to

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