Proton: A Go GUI library

Hey everyone! I’ve been a Go dev for many years now, and I’m sure you’ve noticed that Go has its fair share of headaches when it comes to GUI app development.

I looked at the options out there: Fyne is cool, but CGO? Why? Then there’s Gio… but the learning curve is pretty brutal. Wails is great, but then you’re forced to write HTML, JS, and CSS.

So, I decided to build a pure Go GUI framework right on top of Gio called Proton.

Example code

package main

import "github.com/CzaxStudio/proton"

type UI struct {
    name proton.Editor
    btn  proton.Clickable
}

func main() {
    u := &UI{}
    a := proton.New("my app")
    a.Window("Hello", 480, 300, func(win *proton.Win) {
        proton.H3(win, "Hello from Proton!")
        proton.Gap(win, 8)
        proton.Input(win, &u.name, "Your name")
        proton.Gap(win, 8)
        if proton.Button(win, &u.btn, "Go") {
            println("Hello,", u.name.Text())
        }
    })
    a.Run()
}

It requires zero CGO, it’s dead simple to use, and it’s completely open-source. If this sounds like something you’ve been looking for, please give it a spin! If you try it and don’t like it, I’d love to hear your feedback on what I can fix or improve. Let me know what you think!

1 Like

Starred :+1: more gui libraries for Go always welcomed

Thank You maykie!

really wanted to create something that gives Go developers a clean, immediate-mode layout engine without the headache of Cgo dependencies or heavy web-tech runtimes.

Since you are interested in Go GUI options, I’d love to know: What kind of desktop tools or apps are you usually building (or wanting to build) in Go? If there are specific components or layout widgets you find yourself constantly needing, let me know—I’m actively shaping the roadmap for the next point-releases!"


Note: The API is changed a little. Example code:

package main

import “github.com/CzaxStudio/proton”

func main() {
a := proton.New(“hello”)
a.Window(“Hello”, 400, 200, func(win proton.Context) {
proton.H3(win, “Hello from Proton!”)
})
a.Run()
}