fyne | Cross platform GUI toolkit in Go inspired by Material Design
kandi X-RAY | fyne Summary
kandi X-RAY | fyne Summary
Fyne is an easy-to-use UI toolkit and app API written in Go. It is designed to build applications that run on desktop and mobile devices with a single codebase. Version 2.1 is the current release of the Fyne API, it introduced RichText and the DocTabs container, as well as the document storage API and FyneApp.toml metadata support. We are now working towards the next big release, codenamed bowmore and more news will follow in our news feeds and GitHub project.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of fyne
fyne Key Features
fyne Examples and Code Snippets
Community Discussions
Trending Discussions on fyne
QUESTION
I want to add a GUI to a command line application that I have written in Go but I'm running into problems with fyne and circular dependencies.
Consider this simple example to illustrate the problem I am facing: Assume that a button triggers a time-consuming method on my model class (say fetching data or so) and I want the view to update when the task has finished.
I started by implementing a very naive and not at-all-decoupled solution, which obviously runs into a circular dependency error raised by the go compiler. Consider the following code:
main.go
...ANSWER
Answered 2022-Mar-20 at 16:43You could return the value.
QUESTION
I'm making an application with Fyne.
I need to create a grid where the left column will be fixed and the right column will stretch. In general, there will be a menu on the left, and the main block on the right (a screenshot of the expected one below).
I read the documentation https://developer.fyne.io/container/grid but still don't understand how to do it. Help me please.
Grid
ANSWER
Answered 2022-Mar-07 at 14:54you can check the demo application of Fyne.
QUESTION
I want to make GUI testing, but investigation of test
package and sources of fyne
disappoints a lot.
Could somebody please tell, is there a way to fill text fields of a created dialog and click 'ok' and 'cancel' buttons to check results?
All docs I saw only suggest to move creating of form fields out to a func
and check them out then individually, and, yes, that's an option, but is there a possibility to check it out as a complete dialog?
ANSWER
Answered 2022-Feb-02 at 05:18The test package does not include anything specific for interacting with dialogs. Mostly you interact with each window specifically, the code works out much simpler.
Maybe something has been missed - feel free to provide more info here or open an issue on the GitHub project.
QUESTION
On my fyne
GUI, I want to display text that can be copied by the user. So far, I'm using a (multi-line) widget.Entry
, see example below. Although that works, it seems inappropriate since "entry" implies user-input - which is not the case here.
If I use a widget.Label or canvas.Text, the characters can't be copied. So what's the best approach here?
Example:
...ANSWER
Answered 2022-Jan-07 at 13:36Labels are for display only, they afford no user interaction - this is something that web based apps have confused us about :). In Fyne apps we aim to have all user interaction hinted at, buttons and links are interactive, text is not. There are two possible approaches:
- put a “copy” button next to your label as has become common practice in many apps (for example password managers or YouTube)
- use a disabled Entry so the text can be interacted with but not edited.
QUESTION
How can I detect a drag event in a widget? I've tried this:
...ANSWER
Answered 2021-Dec-20 at 06:36For dragging an item you need to implement the whole Draggable interface (you missed DragEnd
) https://developer.fyne.io/api/v2.0/draggable.html.
However what you describe may be a drop event (part of the OS drag and drop lifecycle) which is not yet supported. The draggable behaviour is for the user feature of dragging an object inside your UI.
QUESTION
Trying to follow the installation guide here and most of the process is working. I'm having an issue with building it however. When trying to build I'm getting this message:
C:...\gameboy.live>go build -o gbdotlive main.go ......\go\pkg\mod\fyne.io\fyne@v1.0.1\driver\gl\gl.go:20:2: missing go.sum entry for module providing package github.com/goki/freetype (imported by fyne.io/fyne/driver/gl); to add: go get fyne.io/fyne/driver/gl@v1.0.1
Running the suggested command however raises another prompt:
C:...\gameboy.live>go get fyne.io/driver/gl@v1.0.1 go get fyne.io/driver/gl@v1.0.1: unrecognized import path "fyne.io/driver/gl": reading https://fyne.io/driver/gl?go-get=1: 404 Not Found
I've tried going for the version 1.4.3 driver too which raises a different error:
C:...\gameboy.live>go get fyne.io/fyne/gl@v1.4.3 go get: module fyne.io/fyne@v1.4.3 found, but does not contain package fyne.io/fyne/gl
Anybody familiar with this issue? FYI I'm on Windows and have MinGw installed already.
...ANSWER
Answered 2021-Dec-19 at 09:53Just run go mod tidy
before exec go build -o gbdotlive main.go
.Have a try.
QUESTION
I don't think I need these menu subitems. Can I somehow handle clicking on the menu element itself?
Something like this:
...ANSWER
Answered 2021-Dec-18 at 19:18A menu without the popup sub-items is just a row of buttons isn’t it? It should be possible to make that with HBox and Button widgets or maybe you want a toolbar instead?
QUESTION
I am using fyne. I am working on a game (with buttons obviously). I would like to know if there is a way to change button's background? I know there is button with image instead of text, but I would only like to change background color of button.
...ANSWER
Answered 2021-Nov-25 at 13:46The Fyne widget APIs are based on meaning rather than graphics, which makes two potential answers.
You can mark a button as high importance (Button.Importance = widget.HighImportance
) which will show as a primary colour.
If your application wishes to control colour then the way you do it is to place a background rectangle under the button, which will show through (e.g. as container.NewMax(canvas.NewRectangle(bgColor), button)
).
QUESTION
I'm trying to build a simple code editor with fyne, and I saw in the doc the widget TextGrid, so I tried to use it, but when I run the code I can't modify the text.
here is the code
...ANSWER
Answered 2021-Nov-22 at 10:51The TextGrid
component is something more developer focused for building more complex components (like a terminal or code editor).
For a ready-to-use text editor use widget.NewMultiLineEditor()
.
You can see a more complete example at https://github.com/fyne-io/examples/blob/develop/textedit/ui.go.
QUESTION
ANSWER
Answered 2021-Nov-19 at 10:50Maybe the cc1.exe is not from the gcc installation? Debugging Windows C compiler installations can be complicated - we have some instructions from scratch on the Fyne docs site https://developer.fyne.io/started/.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install fyne
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page