Fyne bindings · generated with ryegen

Rye-Fyne

Cross-platform GUI applications with the Rye language and the Fyne toolkit.

Write desktop and mobile interfaces in Rye's concise, composable syntax. Bindings follow Fyne's API closely, and updates from goroutines use fyne/do for thread-safe UI changes.

Hello Fyne World
fyne: import\go "fyne"
app: import\go "fyne/app"
widget: import\go "fyne/widget"

a: app/new
w: a .Window "Hello"
w .Set-content widget/label "Hello fyne world!"
w .Show-and-run
What it is

Rye syntax, native Fyne widgets

Rye-Fyne is a distribution of Rye extended with bindings for the Fyne GUI toolkit. Fyne is a pure Go cross-platform toolkit, so the same programs can target Linux, macOS, Windows and mobile platforms.

Bindings are generated by ryegen and follow Fyne’s API closely. Rye’s pipe words, goroutines and interactive console make GUI code compact and easy to explore while it runs.

Native desktop and mobile

Fyne is a pure Go toolkit. Rye-Fyne programs target Linux, macOS, Windows and mobile platforms with the same widget model.

Generated bindings

ryegen produces Rye bindings for the Fyne packages used by your application. Calls stay close to the Go API and are namespaced by package.

Interactive workflow

Rye's console, goroutines, pipe words and failure handling make it practical to prototype an interface and update it while it is running.

Screenshots

Apps built with Rye-Fyne

A small selection of examples and practical applications. The full set is in the cookbook.

Quick examples

Small programs, real interfaces

Button with callback
fyne: import\go "fyne"
app: import\go "fyne/app"
widget: import\go "fyne/widget"
container: import\go "fyne/container"
layout: import\go "fyne/layout"

lab: widget/label "I'm Waiting ..."
btn: widget/button "Click here" does { lab .Set-text "Finally ..." }
box: container/vbox [
    lab
    layout/spacer
    btn
]

a: app/new
w: a .Window "Button"
w .Resize fyne/size 200.0 100.0
w .Set-content box
w .Show-and-run
Live clock · goroutine UI updates
fyne: import\go "fyne"
app: import\go "fyne/app"
widget: import\go "fyne/widget"

lab: widget/label "<date & time>"

go does {
    forever {
        fyne/do does {
            lab |Set-text now .string
        }
        sleep 500
    }
}

w: app/new .Window "Date & Time"
w .Set-content lab
w .Show-and-run
1 million item list
fyne: import\go "fyne"
app: import\go "fyne/app"
widget: import\go "fyne/widget"

lst: widget/list
    does { 1000000 }
    does { widget/label "num" }
    fn { i item } { item .Set-text string i + 1 }

w: app/new .Window "1 million list"
w .Resize fyne/size 220.0 200.0
w .Set-content lst
w .Show-and-run
Composed list rows
fyne: import\go "fyne"
app: import\go "fyne/app"
widget: import\go "fyne/widget"
container: import\go "fyne/container"

players: [ [ "WildJane" 5210 ] [ "MadBob" 4991 ] [ "GreeNoob" 12 ] ]

lst: widget/list
    does { players .length? }
    does { container/hbox [ widget/label "name" widget/label "score" ] }
    fn { i box } {
        player: players -> i
        name-label: 0 <- ( box .Objects? )
        score-label: 1 <- ( box .Objects? )
        name-label |Set-text 0 <- player
        score-label |Set-text string 1 <- player
    }

a: app/new
w: a .Window "Gastown bingo players"
w .Resize fyne/size 220.0 200.0
w .Set-content lst
w .Show-and-run
Download

Get Rye-Fyne

Official builds are published on GitHub Releases. Use the latest release for the current bindings and examples.

Platform Package Download
Linux Portable build and .dwfs.AppBundle Latest release
macOS rye-fyne-macos-amd64.tar.gz Download
Windows rye-fyne.exe Download

To build from source, install Go, clone the repository and generate the bindings for your platform.

Build from source
git clone https://github.com/refaktor/rye-fyne.git
cd rye-fyne
go tool ryegen
go build

./rye-fyne examples/01-hello-world.rye