// Example of how to update the text from the API while the user edits it, // again, mostly for testing. func edits(t *ink.Txt) { time.Sleep(5 * time.Second) t.Ins([]rune("ZZZ\n"), 3) time.Sleep(1 * time.Second) rs := t.Del(3, 4) cmd.Dprintf("did del %s\n", string(rs)) time.Sleep(1 * time.Second) x := t.GetText() x.Ins([]rune("XXX\n"), 2) x.Ins([]rune("XXX\n"), x.Len()) t.SetMark("xx", 30) t.PutText() for i := 0; i < 30; i++ { time.Sleep(time.Second) t.MarkIns("xx", []rune(fmt.Sprintf("--%d--\n", i))) } }