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

Benoît Minisini g4mba5 at gmail.com
Thu May 20 15:07:51 CEST 2021

Le 20/05/2021 à 13:28, Tobias Boege a écrit :
> 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

The symbol clash is logical, as effectively you can't have two GUI 
components, even if one only uses the terminal. So I'm not sure in that 
case you should use a different name of the class.

On the contrary, I think all components should use the same class names 
if they are roughly doing the same thing in a mutually exclusive way.

Benoît Minisini

More information about the User mailing list