Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/borud/console

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/borud/console

  • v0.1.0
  • Source
  • Go
  • Socket score

Version published
Created
Source

Console Fyne Widget

Console is a simple fyne Widget intended for logging messages to a window.

Go Reference

Screenshot

Example

A very simple usage example:

package main
import (
    "fmt"
    "time"

    "fyne.io/fyne/v2"
    "fyne.io/fyne/v2/app"
    "github.com/borud/console"
)

func main() {
    app := app.New()
    win := app.NewWindow("Console test")
    win.Resize(fyne.NewSize(1000, 1000))
    
    console := console.NewConsole()
    console.ScrollToBottom = true
    console.MaxLines = 1000

    go func() {
        for i := 0; ; i++ {
            console.Append(fmt.Sprintf("This is log message %d at %s", i, time.Now().Format(time.RFC3339)))
           time.Sleep(500 * time.Millisecond)
        }
    }()

    win.SetContent(console)
    win.ShowAndRun()
}

Building example

There is a slightly more elaborate example included in cmd/console which you can build by running

make

This will produce the binary bin/console.

Caveats

Note that I'm very new to Fyne so this widget does not seem to be very performant. But if you can live with that (at least until I learn more about Fyne), by all means, use it. If you have ideas on how to improve it, I'd love to hear from you and learn. I made this mostly because I needed the functionality in an application.

You can find me on the Gophers Slack

FAQs

Package last updated on 12 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc