Skip to content
Cross platform GUI in Go based on Material Design
Go
Branch: master
Clone or download
Latest commit 123d31a Aug 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app Fix bad merge with windows patch Aug 17, 2019
canvas Fix erroneous formatting Jun 27, 2019
cmd Use the Select widget for icon name in demo Aug 16, 2019
dialog typo fix Jul 16, 2019
driver/desktop shortcut conforms May 27, 2019
img Scale down 2x images Jun 21, 2019
internal Fix a strange minsize bug that only affected the release branch Aug 17, 2019
layout Update form layout to handle hidden items Aug 16, 2019
scripts/modvendor Add support for go modules (#153) Apr 2, 2019
test Update last addition Aug 17, 2019
theme Update the fyne_demo UI for a all the richness of the 1.1 release Jun 15, 2019
vendor add testify/require to vendor May 26, 2019
widget Dismiss non-modal popovers on secondary tap as well Aug 17, 2019
.gitignore Add the Ability to Change Icon Color (#246) May 5, 2019
.travis.yml report gofmt error details in Travis Jun 11, 2019
AUTHORS update authors Jun 15, 2019
CHANGELOG.md Update last addition Aug 17, 2019
CODE_OF_CONDUCT.md Added full version of the code of conduct Feb 10, 2019
LICENSE Add BSD license Feb 24, 2018
README.md Maintain image aspect on mobile Jun 22, 2019
app.go Minor godoc tweaks Feb 15, 2019
app_test.go Remove dead code and add missing tests Mar 7, 2019
canvas.go Add support to capture the content of a canvas May 12, 2019
canvas_test.go Remove debug output Sep 3, 2018
canvasobject.go Merge origin/develop into bugfix/dragging Jun 15, 2019
clipboard.go Add paste support to entry widget (#89) Feb 28, 2019
container.go Revert "Revert "Fix hidden semantics so children remain hidden when p… Aug 16, 2019
container_test.go Revert "Revert "Fix hidden semantics so children remain hidden when p… Aug 16, 2019
driver.go Move the location lookup code into driver May 11, 2019
event.go replace state in DragEvent by providing drag end event Jun 15, 2019
fyne.go Tweak godoc example Feb 13, 2019
geometry.go Minor godoc tweaks Feb 15, 2019
geometry_test.go Fix project imports Dec 29, 2018
go.mod update testify to master May 20, 2019
go.sum update testify to master May 20, 2019
key.go Add paste support to entry widget (#89) Feb 28, 2019
layout.go Minor godoc tweaks Feb 15, 2019
log.go Improve error handling (#152) Mar 16, 2019
log_test.go Improve error handling (#152) Mar 16, 2019
math.go Minor godoc tweaks Feb 15, 2019
math_test.go Fix project imports Dec 29, 2018
menu.go Add menus and a menubar for desktop apps May 17, 2019
menu_test.go Just a few tests (canvas/circle & fyne.Menu) (#275) May 28, 2019
resource.go Remove the now not needed Resource.CachePath Feb 20, 2019
resource_test.go Remove the now not needed Resource.CachePath Feb 20, 2019
serialise.go Remove the now not needed Resource.CachePath Feb 20, 2019
serialise_test.go Remove the now not needed Resource.CachePath Feb 20, 2019
settings.go Update Settings() to be in app, not global Dec 20, 2018
shortcut.go Add paste support to entry widget (#89) Feb 28, 2019
shortcut_test.go Add more tests :) Mar 16, 2019
text.go Minor godoc tweaks Feb 15, 2019
theme.go small scrollbar unless hovered Jun 8, 2019
widget.go Clean up widgets when they are no longer needed (#151) Mar 15, 2019
window.go Add menus and a menubar for desktop apps May 17, 2019

README.md

GoDoc Reference 1.1 release Join us on Slack Support Fyne.io
Code Status Build Status Coverage Status

About

Fyne is an easy to use UI toolkit and app API written in Go. We use OpenGL (through the go-gl and go-glfw projects) to provide cross platform graphics.

Version 1.1 is the current release which added lots of new functionality including gradients, shadows and new widgets. We are now working towards 1.2 which will complete the basic UI toolkit phase of development.

Widget demo

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

cd $GOPATH/src/fyne.io/fyne/cmd/fyne_demo/
go build
./fyne_demo

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

Getting Started

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

Prerequisites

As Fyne uses CGo you will require a C compiler (typically gcc). If you don't have one set up the instructions at Compiling may help.

By default Fyne uses the gl golang bindings which means you need a working OpenGL configuration. Debian/Ubuntu based systems may also need to install the libgl1-mesa-dev and xorg-dev packages.

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

go get fyne.io/fyne

Code

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

package main

import (
	"fyne.io/fyne/widget"
	"fyne.io/fyne/app"
)

func main() {
	app := app.New()

	w := app.NewWindow("Hello")
	w.SetContent(widget.NewVBox(
		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

Note that Windows applications load from a command prompt by default, which means if you click an icon you may see a command window. To fix this add the parameters -ldflags -H=windowsgui to your run or build commands.

Documentation

More documentation is available at the Fyne developer website or on godoc.org.

Examples

You can find many example applications in the examples repository. Alternatively a list of applications using fyne can be found at our website

You can’t perform that action at this time.