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 a separator ToolbarItem. Oct 11, 2018
cmd Move example apps out to examples repo Oct 5, 2018
desktop Add a toolbar to the widget set Oct 11, 2018
dialog Add customisation for dialog button text. Oct 11, 2018
examples Don't use log if we don't need to Oct 13, 2018
img Update readme to remove examples and clean out images Oct 5, 2018
layout Add a declarative API variant to Spacer Oct 11, 2018
test Add a fixed window hint so we can set dialogs to not resize Sep 30, 2018
theme Update light theme for slightly better readability Oct 11, 2018
widget Fix right align and center since adding multiline support Oct 13, 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 to remove examples and clean out images Oct 5, 2018
app.go Refactor the test canvas/window usage to be more real Jul 23, 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 Add a monospaced font Jul 12, 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 Fix some typos Oct 1, 2018
container.go Refactor widget and container theme handling Jul 23, 2018
container_test.go Add a simple test for theme package Jun 20, 2018
driver.go Update driver text doc Jul 18, 2018
event.go Refactor everything in ui/ to the root package Jun 20, 2018
fyne.go Updating examples Jul 18, 2018
geometry.go Refactor everything in ui/ to the root package Jun 20, 2018
geometry_test.go Refactor everything in ui/ to the root package Jun 20, 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 Fix indenting, match current gofmt in generated resources Aug 24, 2018
serialise_test.go Fix indenting, match current gofmt in generated resources Aug 24, 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 Add a dialog.ShowCustom function for handling bespoke needs Oct 1, 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 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.Show()
    }

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/examples/
go run main.go

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.Show()
}

Examples

The main examples have been moved - you can find them in their [own repository][https://github.com/fyne-io/examples/].