Impossible to create a custom ConsoleDriver
See original GitHub issueHello guys, currently I need 24 bit color support for my console application.
In the past there was an attempt to bring this feature to Terminal.Gui (see pull #103). But the code never get into the main branch.
So I thought I can just create my own ConsoleDriver
with the source provided there and use the Application.Init
to serve my class. However, this is impossible.
Although the abstract base class ConsoleDriver
is public, you cannot derive it from outside the library because the Contents
field is defined as internal abstract.
Moreover there are several such things where classes and field are defined internal making them inaccessible from outside.
To name some of them:
internal class NetDriver
internal class WindowsDriver
internal static View Application.mouseGrabView
internal static View Application.wantContinuousButtonPressedView
Due to the internality of the Application
fields which also used by the ConsoleDriver
you get a second level of restriction which makes the whole thing unusable outside.
I would like to appreciate if the internal fields get defined as public as most as possible. So everyone who wants a custom implementation of a class can access the required structures. This would also improve feature testing and development outside the library more convenience.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top GitHub Comments
With the PR #1770 is now possible to create a custom
ConsoleDriver
that can enjoy all theTerminal.Gui
features. I think this issue can be closed.Hello,
Generally I dislike exposing internal details because it ties our hands in the future.
I much rather incorporate true-color support directly into the library, which achieves the stated goal, but also gives us the freedom to change the internals in the future, without breaking any existing code.