raku-Vikna icon indicating copy to clipboard operation
raku-Vikna copied to clipboard

Have configurable borders via subclassing?

Open Xliff opened this issue 5 years ago • 1 comments

https://github.com/vrurg/raku-Vikna/blob/7f4da292861bb53480246c0586ffa602b1a3e797/lib/Term/UI/Window/Border.rakumod#L5

Might a more versatile mechanism for this be a method that returns this hash?

Something like

method borders {
        ansi => %(
            :ul<+>, :t<->, :ur<+>,
             :l<|>,         :r<|>,
            :bl<+>, :b<->, :br<+>,
            # Connectors
            :cl<+>, :cr<+>, :ct<+>, :cb<+>,
        ),
        ;
}

This way a subclass would only need to override borders and both borders and draw?

Xliff avatar Dec 09 '19 23:12 Xliff

As this was just a quick hack, I was considering an option to add specific support for unicode borders. Though you pushed my thoughts into another direction.

What could be done and it's rather cheap from the syntax point of view is I can utilize OO::Plugin module. It would allow to make basically any framework class extendable by a user. And it would be totally transparent for the framework itself.

vrurg avatar Dec 10 '19 02:12 vrurg