Cross platform GUIs in Go based on EFL
Switch branches/tags
Nothing to show
Clone or download
Permalink
Failed to load latest commit information.
canvas Add the ability to hide (and re-show) objects and widgets Nov 6, 2018
cmd Remove examples dir and move to cmd/fyne_demo Nov 8, 2018
desktop Fix offset calculations for click handlers Nov 8, 2018
dialog Add customisation for dialog button text. Oct 11, 2018
img Update to latest example in screenshots Oct 26, 2018
layout Add the ability to hide (and re-show) objects and widgets Nov 6, 2018
test Change window semantics so Show() no longer blocks Oct 27, 2018
theme Update color API to color.Color from color.RGBA Nov 4, 2018
widget Fix theme applying for tab container Nov 8, 2018
.gitignore Ignore GoLand files Aug 24, 2018
.travis.yml And generate the coverage Sep 17, 2018
AUTHORS Add BSD license Feb 24, 2018
LICENSE Add BSD license Feb 24, 2018
README.md Update readme for new demo location Nov 10, 2018
app.go Change window semantics so Show() no longer blocks Oct 27, 2018
app_bsd.go First pass at adding some BSD support to Fyne Jun 21, 2018
app_darwin.go Fix the app OS specifics for CI environment. Jun 20, 2018
app_linux.go Fix the app OS specifics for CI environment. Jun 20, 2018
app_other.go First pass at adding some BSD support to Fyne Jun 21, 2018
app_test.go Change window semantics so Show() no longer blocks Oct 27, 2018
app_windows.go Fix the app OS specifics for CI environment. Jun 20, 2018
canvas.go Refactoring refresh code out of theme apply code. Sep 3, 2018
canvas_test.go Remove debug output Sep 3, 2018
canvasobject.go Add the ability to hide (and re-show) objects and widgets Nov 6, 2018
container.go Fix theme applying for tab container Nov 8, 2018
container_test.go Add the ability to hide (and re-show) objects and widgets Nov 6, 2018
driver.go Change window semantics so Show() no longer blocks Oct 27, 2018
event.go Refactor everything in ui/ to the root package Jun 20, 2018
fyne.go Updating examples Jul 18, 2018
geometry.go Fix offset calculations for click handlers Nov 8, 2018
geometry_test.go Fix offset calculations for click handlers Nov 8, 2018
key.go Refactor everything in ui/ to the root package Jun 20, 2018
layout.go Refactor everything in ui/ to the root package Jun 20, 2018
math.go Refactor everything in ui/ to the root package Jun 20, 2018
math_test.go Refactor everything in ui/ to the root package Jun 20, 2018
mouse.go Refactor everything in ui/ to the root package Jun 20, 2018
path.go Move resource and serilisation code into main package Jun 19, 2018
resource.go Fix indenting, match current gofmt in generated resources Aug 24, 2018
resource_test.go Rework the Resource API - this allows us to pass ThemedResource or bu… Aug 24, 2018
serialise.go Use the GoStringer interface for the purpose of converting to Go code Oct 17, 2018
serialise_test.go Use the GoStringer interface for the purpose of converting to Go code Oct 17, 2018
settings.go Add tests for settings code Jun 20, 2018
settings_test.go Add tests for settings code Jun 20, 2018
text.go Fix alignment API issue with Label Sep 20, 2018
widget.go Refactoring refresh code out of theme apply code. Sep 3, 2018
window.go Change window semantics so Show() no longer blocks Oct 27, 2018

README.md

GoDoc Reference Code Status Build Status Coverage Status Used By

About

Fyne is an easy to use UI toolkit and app API written in Go. We use the EFL render pipeline to provide cross platform graphics.

This is under heavy development and is not yet capable of supporting a full application

Getting Started

Fyne is designed to be really easy to code with, here are the steps to your first app.

Prerequisites

Before you can use the Fyne tools you need to have a stable copy of EFL (at least 1.19) installed. This will be automated by our bootstrap scripts soon, but for now you can follow our setup instructions.

Then using standard go tools you can install Fyne's core library using:

go get github.com/fyne-io/fyne

Code

And then you're ready to write your first app!

    package main

    import "github.com/fyne-io/fyne/widget"
    import "github.com/fyne-io/fyne/desktop"

    func main() {
    	app := desktop.NewApp()

    	w := app.NewWindow("Hello")
    	w.SetContent(widget.NewList(
    		widget.NewLabel("Hello Fyne!"),
    		widget.NewButton("Quit", func() {
    			app.Quit()
    		}),
    	))

    	w.ShowAndRun()
    }

And you can run that simply as:

go run main.go

It should look like this:

Fyne Hello Dark Theme

Scaling

Fyne is built entirely using vector graphics which means that applications that are written using it will scale to any value beautifully (not just whole number values). The default scale value is equated from your screen's DPI - and if you move a window to another screen it will re-calculate and adjust the window size accordingly!

Hello normal size
Standard size
Hello small size
FYNE_SCALE=0.5
Hello large size
FYNE_SCALE=2.5

Themes

Fyne ships with two themes by default, "light" and "dark". You can choose which to use with the environment variable FYNE_THEME. The default is dark:

Fyne Hello Dark Theme

If you prefer a light theme then you could run:

FYNE_THEME=light go run main.go

It should then look like this:

Fyne Hello Light Theme

Widget demo

To run a showcase of the features of fyne execute the following:

cd $GOPATH/src/github.com/fyne-io/fyne/cmd/fyne_demo/
go run .

And you should see something like this (after you click a few buttons):

Fyne Hello Light Theme

Or if you are using the light theme:

Fyne Hello Light Theme

Declarative API

If you prefer a more declarative API then that is provided too. The following is exactly the same as the code above but in this different style.

package main

import "github.com/fyne-io/fyne"
import "github.com/fyne-io/fyne/desktop"
import "github.com/fyne-io/fyne/widget"

func main() {
	app := desktop.NewApp()

	w := app.NewWindow("Hello")
	w.SetContent(&widget.List{Children: []fyne.CanvasObject{
		&widget.Label{Text: "Hello Fyne!"},
		&widget.Button{Text: "Quit", OnTapped: func() {
			app.Quit()
		}},
	}})

	w.ShowAndRun()
}

Examples

The main examples have been moved - you can find them in their own repository.