Skip to content

Canvas-like Components? #1646

Answered by tznind
Billaferd asked this question in Q&A
Mar 16, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

Hey that sounds like a fun project.

The closest thing to a canvas currently is GraphView which supports scrolling, zooming and drawing lines of fixed characters (for bar graphs, line graphs etc). It supports annotations and is designed to be expandable for new Series and Annotations.

However if you have a map or world class that knows what it wants displayed as characters then it is very easy to subclass View and output them at the required locations in the view. For example:

using Terminal.Gui;

Application.Init();

var myView = new MyView();

Application.MainLoop.AddTimeout(TimeSpan.FromSeconds(1),
    (l)=>{
        myView.SetNeedsDisplay();
        return true;
    });

Application.Top.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Billaferd
Comment options

Answer selected by Billaferd
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants