// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Binary textdemo displays a couple of Text widgets.
// Exist when 'q' is pressed.
packagemain
import(
"context"
"fmt"
"math/rand"
"time"
"github.com/mum4k/termdash"
"github.com/mum4k/termdash/cell"
"github.com/mum4k/termdash/container"
"github.com/mum4k/termdash/draw"
"github.com/mum4k/termdash/terminal/termbox"
"github.com/mum4k/termdash/terminalapi"
"github.com/mum4k/termdash/widgets/text"
)
// quotations are used as text that is rolled up in a text widget.
varquotations=[]string{
"When some see coincidence, I see consequence. When others see chance, I see cost.",
"You cannot pass....I am a servant of the Secret Fire, wielder of the flame of Anor. You cannot pass. The dark fire will not avail you, flame of Udûn. Go back to the Shadow! You cannot pass.",
"I'm going to make him an offer he can't refuse.",
"May the Force be with you.",
"The stuff that dreams are made of.",
"There's no place like home.",
"Show me the money!",
"I want to be alone.",
"I'll be back.",
}
// writeLines writes a line of text to the text widget every delay.
iferr:=wrapped.Write(". Wraps long lines at rune boundaries if the WrapAtRunes() option is provided.\nSupports newline character to\ncreate\nnewlines\nmanually.\nTrims the content if it is too long.\n\n\n\nToo long.");err!=nil{