On Apr 5, 2020, at 12:37 AM, Chris McGee <newton...@gmail.com> wrote:
> 
> You can try this Go library by mischief and some examples in the cmd package:
> https://bitbucket.org/mischief/draw9/src/default/ 
> <https://bitbucket.org/mischief/draw9/src/default/>
Thank you, thank you! Here is the Go version of black.c:

package main

import (
        "bitbucket.org/mischief/draw9"
        "fmt"
        "image"
        "log"
        "time"
)

func main() {
        disp, err := draw9.InitDraw(nil, "", "black")
        if err != nil {
                log.Fatal(err)
        }
        screen := disp.ScreenImage
        rect := screen.R
        black := disp.Black
        screen.Draw(rect, black, nil, image.ZP)
        disp.Flush()
        time.Sleep(5 * time.Second)
        disp.Close()
        fmt.Println("rectangle was", rect)
}

One minor issue: the window is white after the program exits. Text doesn’t show 
until I hit the up and down arrow keys.

Kim
------------------------------------------
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T0d490c91935dc74b-Mafdc841624250ef10fd67459
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

Reply via email to