DEFyne
This repo contains the work-in-progress Fyne IDE.
Features
- Embedded terminal
TODO
- Various types of editor
- Syntax highlighting
- Standard run/test buttons
This repo contains the work-in-progress Fyne IDE.
2022/08/04 00:09:32 Please select a container 2022/08/04 00:09:45 Please select a container 2022/08/04 00:09:47 Please select a container 2022/08/04 00:11:24 // auto-generated // Code generated by Defyne GUI builder.
package main
import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/app" )
type gui struct {
}
func newGUI() *gui { return &gui{} }
func (g *gui) makeUI() fyne.CanvasObject { g.5 = container.NewHBox( container.New(), widget.NewSeparator(), widget.NewSeparator())
return g.5}
2022/08/04 00:11:24 Fyne error: Failed to encode GUI code 2022/08/04 00:11:24 Cause: 22:3: expected ';', found .5 (and 1 more errors) 2022/08/04 00:11:24 At: /home/o/go/pkg/mod/github.com/fyne-io/[email protected]/internal/guibuilder/main.go:353 /tmp/fynebuilder/main.go:2:1: expected 'package', found 'func' 2022/08/04 00:11:33 // auto-generated // Code generated by Defyne GUI builder.
package main
import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/app" )
type gui struct {
}
func newGUI() *gui { return &gui{} }
func (g *gui) makeUI() fyne.CanvasObject { g.5 = container.NewHBox( container.New(), widget.NewSeparator(), widget.NewSeparator())
return g.5}
2022/08/04 00:11:33 Fyne error: Failed to encode GUI code 2022/08/04 00:11:33 Cause: 22:3: expected ';', found .5 (and 1 more errors) 2022/08/04 00:11:33 At: /home/o/go/pkg/mod/github.com/fyne-io/[email protected]/internal/guibuilder/main.go:353 /tmp/fynebuilder/main.go:2:1: expected 'package', found 'func'
Currently, if you start defyne without specifying a directory, you get prompted to select a project to open or create a new project. Creating a new project causes a nil reference as the value of dir
in createProject()
is still undefined.
This patch uses the home directory (via os.UserHomeDir
) as a suitable default path value to avoid a crash when the user enters a project name without specifying a directory to place the new project in.
Andy mentioned that there are bonus points for extending this patch by storing the last-opened project in persistent storage via App.Preferences.
❯ go get github.com/fyne-io/defyne
go: downloading github.com/fyne-io/defyne v0.0.0-20210412103144-b07e6a0b41ed
go: downloading fyne.io/fyne/v2 v2.0.2
go: downloading fyne.io/x/fyne v0.0.0-20210407180700-b277e3225fbe
go: downloading github.com/fyne-io/terminal v0.0.0-20210410133030-a03d1d963afd
go: downloading github.com/creack/pty v1.1.11
go: downloading github.com/fyne-io/mobile v0.1.3-0.20210318200029-09e9c4e13a8f
go: downloading github.com/go-gl/glfw/v3.3/glfw v0.0.0-20210311203641-62640a716d48
# github.com/fyne-io/defyne
go/pkg/mod/github.com/fyne-io/[email protected]/defyne.go:20:15: undefined: container.DocTabs
go/pkg/mod/github.com/fyne-io/[email protected]/panels.go:18:15: undefined: container.NewDocTabs
❯ echo $?
2
❯ go version
go version go1.16 linux/amd64
go version:go1.18 linux/amd64 My operation steps:
Summary: On a newly built copy of defyne, launching defyne without specifying a directory, and without specifying a 'new project' directory causes a crash upon creating a new project. Only 'New' seems to exhibit this behavior, the 'Open' option works and opens the project successfully.
Info: go version go1.17.5 linux/amd64
Steps to recreate:
crash output
$ ./defyne
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x65ab02]
goroutine 24 [running]:
fyne.io/fyne/v2/storage/repository.ForURI({0x0, 0x0})
/home/dh/go/pkg/mod/fyne.io/fyne/[email protected]/storage/repository/repository.go:255 +0x22
fyne.io/fyne/v2/storage.Child({0x0, 0x0}, {0xc000e663d0, 0x8})
/home/dh/go/pkg/mod/fyne.io/fyne/[email protected]/storage/uri.go:111 +0x31
main.createProject({0x0, 0x0}, {0xc000e663d0, 0x8})
/home/dh/Code/Golang/defyne/project.go:105 +0x4b
main.(*defyne).showNewProjectDialog.func2(0x80)
/home/dh/Code/Golang/defyne/project.go:42 +0x6d
fyne.io/fyne/v2/dialog.(*dialog).hideWithResponse(0xc000136600, 0xe0)
/home/dh/go/pkg/mod/fyne.io/fyne/[email protected]/dialog/base.go:156 +0x42
fyne.io/fyne/v2/dialog.NewForm.func1()
/home/dh/go/pkg/mod/fyne.io/fyne/[email protected]/dialog/form.go:62 +0x25
fyne.io/fyne/v2/widget.(*Button).Tapped(0xc00014c6e0, 0xc000140201)
/home/dh/go/pkg/mod/fyne.io/fyne/[email protected]/widget/button.go:194 +0x53
fyne.io/fyne/v2/internal/driver/glfw.(*window).mouseClickedHandleTapDoubleTap.func1()
/home/dh/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/window.go:891 +0x26
fyne.io/fyne/v2/internal/driver/common.(*Window).RunEventQueue(0xc000140200)
/home/dh/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/common/window.go:58 +0x56
created by fyne.io/fyne/v2/internal/driver/glfw.(*gLDriver).createWindow.func1
/home/dh/go/pkg/mod/fyne.io/fyne/[email protected]/internal/driver/glfw/window.go:1395 +0x15b
Possible solution: The issue seems to happen when the user is not prevented from proceeding without defining a directory for the new project. The assumption is that the value for creating the new directory is still nil
at the point which the program is attempting to create the project without a value. Deactivating or removing the button before the value for directory != nil could help keep this from happening.
Allow widgets and containers to have a name (ID) so that we can reference them in code.
This also changes the default GUI setup code so we return a struct (pointer) that will encapsulate these vars instead of using globals.
One thing that would immediately be useful would be possibility to add specific GUI-functionality via defyne that is currently missing in standard fyne - like Tooltips. Or easily add an image into a container.
(And while I am at it ... easily add an png to be used as an icon. And then be able to have the whole app be put together by creating the necessary "makefiles"... = make an Graphical UI for the whole https://developer.fyne.io/started/packaging fyne part!)
Defyne is actually usable... Great stuff !
Can you add some test projects ?
It would make it easier to experiment and also for me and others to help. Maybe a "ProjectTests" folder in the repo for now ?
I got some various widgets working and understand how the system fundamentally works. Seems to maintain a json description and then gen the golang from that json. It would be nice if a basic docs folder explained this, again so that others can help.
I am curious that is the architectural plan to add logic. For example click a button and change some text.
Separate GUI file transpiler out from IDE.
I just try out defyne and its GUI editor, it's great. But I can't find a way to make *.gui.json into a go file. Anyway, will defyne expose the transpiler (maybe just the function) or separate it into another module (function only or cli app). So that I can do something like...
w := app.New().NewWindow("Application")
w.SetContent(defyne.DecodeJSON("MainWindow.gui.json"))
w.ShowAndRun()
or
$> defyne compile
# MainWindow.gui.json --> MainWindow.gui.go
I am new to fyne but glad that someone bringing GUI to golang. Thank you for working on fyne and defyne.
Something simple that helps new-to-fyne developers to load some template apps to get them up and running. Such as...
With some nice icons, descriptions and filling in the blanks so we can generate a complete project.
Gide Gide is a flexible IDE (integrated development environment) framework in pure Go, using the GoGi GUI (for which it serves as a continuous testing
Project website: http://goclipse.github.io/ As of 2017, Goclipse is no longer actively maintained, see this blog post for more information. If you are
Welcome to godev! The aim of this project is to develop a premier Go language IDE hosted in a web interface. This was inspired by the way that the god
golab golab was a Go IDE for Linux. This project is no longer maintained and might not build due to chganges in dependency projects. The author (mb0)
GoSublime Intro GoSublime is an IDE-like plugin for Sublime Text 3 mainly, but not limited to, providing integration for most of your Go/Golang develo
DEFyne This repo contains the work-in-progress Fyne IDE. Features Embedded terminal TODO Various types of editor Syntax highlighting Standard run/test
About FyneDesk is an easy to use Linux/Unix desktop environment following material design. It is build using the Fyne toolkit and is designed to be ea
Chess The subject of my current live stream series. A simple chess UI built with Fyne. Thanks to: Chess Go library by Logan Spears github.com/notnil/c
fyne-theme-generator WYSIWYG theme editor for Fyne Installation go get github.com/lusingander/fyne-theme-generator Usage You can change each parameter
Fin, the Fyne Login Manager This app is in it's very early stages and has only been tested with pam and systemd to log in users with a .xinitrc file.
Fibro Really early days proof of concept for a cross-platform multi-server chat. Feel free to play, but don't expect it to do much! Features Multiple
Virtual-Operating-System This is a Virtual Operating System made by using GOLANG and FYNE. Hello! All In this project I have made a virtual Operating
Fin, the Fyne Login Manager A minimal but good-looking login manager for Linux/Unix. The current boot scripts support only systemd. If you'd like to t
Virtual Operating System Virtual Operating System Using Golang And Fyne Implemen
Operating-System This is a Virtual Operating System made by using GOLANG and FYN
golauncher A go application launcher A simple, highly extensible, customizable application launcher and window switcher written in less than 300 lines
Hybro Drink Up Homie! App To Remind Myself To Drink Water. Probably also will ke
LiteIDE X Introduction LiteIDE is a simple, open source, cross-platform Go IDE. Version: X37.3 (support Go modules) Author: visualfc Features Core fea
Gide Gide is a flexible IDE (integrated development environment) framework in pure Go, using the GoGi GUI (for which it serves as a continuous testing
Project website: http://goclipse.github.io/ As of 2017, Goclipse is no longer actively maintained, see this blog post for more information. If you are