[Gambas-user] gb.ncurses component would be unusable?

Tobias Boege tobs at taboege.de
Thu May 20 13:28:20 CEST 2021


On Thu, 20 May 2021, Bruce Steers wrote:
> On Thu, 20 May 2021 at 11:21, CD <claude.dessere at orange.fr> wrote:
> 
> > Hello,
> >
> > when, in Project/Properties/Component,
> > I check gb.ncurses, and I launch the execution (in the IDE in design mode) of the program,
> > I have a message (a balloon that points to native code):
> > "'Screen.Height' is incorrectly overridden in class 'Screen'"
> > the program goes into pauses.
> > If I continue the execution by pressing Play again, message (info):
> > "The program returned the value: 1"
> > Click on OK, the program stops.
> >
> > Is the NCurses component unusable?
> >
> I have made this same mistake.
> 
> ncurses is CLI only and cannot be used with any sort of GUI application.
> 

To expand on this: the error you see comes from the fact that you apparently
have one of the GUI components (gb.gtk*, gb.qt*, gb.gui.*) loaded, which
provides a class named Screen representing on your computer screen.

gb.ncurses also exports a class named Screen to represent the terminal of
the ncurses application.

These two classes of the same name have incompatible interfaces. This happened
by bad luck. gb.ncurses is not unusable, but it is not usable together with a
GUI component. You either pick GUI or TUI.

The proposed work on namespaces would fix this incompatibility in the future.
It is not that the two kinds of UI are inherently or by design incompatible,
but by accident of a class name collision.

Best,
Tobias

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list