fyne-io / developer.fyne.io Goto Github PK
View Code? Open in Web Editor NEWFyne developer documentation website
Home Page: https://developer.fyne.io
Fyne developer documentation website
Home Page: https://developer.fyne.io
When the fyne size is changed (Non-Normal size) by fyne_settings, the image size and font size are changed, however the window size will not be changed.
This happens with the image being resized with the original image size and "FillMode = canvas.ImageFillOriginal".
Below is a program that reproduces this bug.
Execute the following program after changing the size to "Tiny" size instead of "Normal" size with the fyne_settings command.
package main
import (
"os"
"image"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
)
func loadImage(imgFile string)*canvas.Image{
if file,err := os.Open(imgFile); err == nil{
defer file.Close()
if img,_,err := image.Decode(file); err == nil{
cnvsImg := canvas.NewImageFromImage(img)
cnvsImg.FillMode = canvas.ImageFillOriginal
cnvsImg.Resize(fyne.NewSize(float32(img.Bounds().Dx()), float32(img.Bounds().Dx())))
return cnvsImg
}
}
return nil
}
func main() {
if len(os.Args) == 2{
app := app.New()
if img := loadImage(os.Args[1]); img != nil{
win := app.NewWindow("Image Viewer")
label := widget.NewLabel(os.Args[1])
cntr := container.NewWithoutLayout(img)
win.SetContent(container.NewVBox(cntr, label,))
win.ShowAndRun()
}
}
}
I propose that we add a page for displaying the icons that exist within the theme package. A bit like how we do for layouts, but for icons instead. This would make it easy for users to see what icons exist and then pick the one that suits their use case.
The attached test:
-works after "go run . 12" and click
-crashes after "go run . 4" and click
main.txt
it has been 2 day no one reviewed my pull request.
It is go get fyne.io/[email protected]
and it should be go get fyne.io/fyne/[email protected]
In the tutorials, there should be an example of customizing button colors.
Yes
A tutorial on setting a button color.
Is there a widget reference for fyne? I want to see a demo of the widgets without downloading/installing fyne.
I followed the command described on https://developer.fyne.io/started/#run-the-demo
Since the text says "If you want to see the Fyne toolkit in action before you start to code your own application", I (wrongly) assumed I did not have to do / install anything first.
This is the output from my computer executed in folder 'temp':
➜ temp go run fyne.io/fyne/v2/cmd/fyne_demo
no required module provides package fyne.io/fyne/v2/cmd/fyne_demo: go.mod file not found in current directory or any parent directory; see 'go help modules'
➜ temp go version
go version go1.18 darwin/arm64
Later on I realised that the author meant that I had to do the steps described in Downloading section first. You need to take the phrase 'to code' literally.
However if you execute go mod tidy - it will remove the required fyne dependency since there is no Go file referencing it.
If you skip go mod tidy, so the dependency is there, you are also out of luck since there is no go.sum file.
So after repeating the steps in the Download section, I got the following error message:
➜ temp go run fyne.io/fyne/v2/cmd/fyne_demo
no required module provides package fyne.io/fyne/v2/cmd/fyne_demo; to add it:
go get fyne.io/fyne/v2/cmd/fyne_demo
If you execute above go get command, it works.
A solution is to move the Installing section up, as first part of Running the demo.
see above
No response
n/a
latest
1.18
macOS
12.2.1
No response
Looks like there's a problem with the documentation generator as https://developer.fyne.io/api/v2.1/theme/ is pretty empty.
What:
Example code: https://developer.fyne.io/tour/basics/windows.html
Environment:
Fedora 33
go version go1.15.8 linux/amd64
Problem:
After closing main window the program seems to still run.
Steps:
Result:
Even after closing the window, the console is not released and the process lingers:
trochej 72955 2.3 0.0 1750860 23404 pts/1 Sl+ 20:39 0:00 go run test.go
trochej 73054 4.3 0.2 1960936 67304 pts/1 Sl+ 20:39 0:00 /tmp/go-build574735481/b001/exe/test
i would like to make some changes in the css files but i don't understand how do i start the development server in my computer
please help me to start the server or give me the commands to start the server
my OS: win 10
NOTE: i've already install ruby on machine
warning: 'NSUserNotification' is deprecated: first deprecated in macOS 11.0 - All NSUserNotifications API should be replaced with UserNotifications.frameworks API [-Wdeprecated-declarations]
Tried out this lib today but it seems like there is a deprecated warning for the macos dependencys?
I wanted to try out fyne and used the form
example from here.
Building and running it gives me this UI, where I can only see the first column of the form, see screenshot.
color.RGBA{0xff, 0, 0, 0xff}
instead of color.White
) in the code still renders odd form layout, rows doesn't seem to get aligned vertically.With the white background/foreground
With other foreground, still rendered odd:
Copy from the example page:
package main
import (
"image/color"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/layout"
)
func main() {
myApp := app.New()
myWindow := myApp.NewWindow("Form Layout")
label1 := canvas.NewText("Label 1", color.Black)
value1 := canvas.NewText("Value", color.White)
label2 := canvas.NewText("Label 2", color.Black)
value2 := canvas.NewText("Something", color.White)
grid := container.New(layout.NewFormLayout(), label1, value1, label2, value2)
myWindow.SetContent(grid)
myWindow.ShowAndRun()
}
fyne.io/fyne/v2 v2.2.3
go version go1.19.2 darwin/arm64
macOS
MacOS Monterey 12.6 (Apple M1 Pro)
No response
The entry reads:
func ShowEntryDialog
func ShowEntryDialog(title, message string, onConfirm func(string), parent fyne.Window)
ShowEntryDialog creates a new entry dialog and shows it immediately.Deprecated: Use dialog.ShowFormDialog() with a widget.Entry inside instead.
There is no dialog.ShowFormDialog(). The reference should be to dialog.ShowForm()
Hi there,
I am working on some app to connect musicians with extremely low delay over the internet.
I am attaching a working proposal that would allow handling generic elements in Select widgets.
Keep it up, this is a fantastic library!!
Claudio
package widgets
import (
"fmt"
"fyne.io/fyne/widget"
)
type Anything interface {}
type SelectInfo struct {
Widget *widget.Select
infoMap map[string]Anything
callback func(string)
stringer func(Anything) string
}
func NewSelectInfo(
stringer func(Anything) string,
changed func(Anything)) *SelectInfo {
c := &SelectInfo{
stringer: stringer,
infoMap: make(map[string]Anything),
}
c.Widget = widget.NewSelect(
make([]string, 0),
func(s string) {
changed(c.inverseStringer(s))
})
return c
}
func (c *SelectInfo) Selected() Anything {
return c.infoMap[c.Widget.Selected]
}
func (c *SelectInfo) Reset() {
c.Widget.Options = make([]string, 0)
c.infoMap = make(map[string]Anything)
}
func (c *SelectInfo) LoadInfo(x Anything) error {
key := c.stringer(x)
_, found := c.infoMap[key]
if found {
return fmt.Errorf("key:[%s] already in the map", key)
}
c.infoMap[key] = x
c.Widget.Options = append(c.Widget.Options, key)
return nil
}
func (c *SelectInfo) SelectInfo(x Anything) {
c.SelectText(c.stringer(x))
}
func (c *SelectInfo) SelectText(s string) {
if len(c.infoMap) == 0 {
return
}
_, found := c.infoMap[s]
if !found {
c.Widget.SetSelectedIndex(0)
}
c.Widget.SetSelected(s)
}
func (c *SelectInfo) inverseStringer(in string) Anything {
v, _ := c.infoMap[in]
return v
}
I'm leaning go and i'm readning fyne toturial, the border layout example at here is little not clear, i think you should use button widget replace the original white label text.
before
after
This very first fyne example in the API documentation does not compile because the package widget
has no function NewVBox
.
package main
import "fyne.io/fyne/v2/app"
import "fyne.io/fyne/v2/widget"
func main() {
a := app.New()
w := a.NewWindow("Hello")
hello := widget.NewLabel("Hello Fyne!")
w.SetContent(widget.NewVBox(
hello,
widget.NewButton("Hi!", func() {
hello.SetText("Welcome :)")
}),
))
w.ShowAndRun()
}
Example prog here: https://github.com/fyne-io/developer.fyne.io/blob/master/api/v2.0/index.md
still references widget.NewVBox -> container. of course
:)
I have been trying to run this as the instruction suggest in my ubuntu with ruby 3.2 and using the docker image of jekyll
and I am getting loads of issues:
on docker:
devfyne-jekyll | Configuration file: /site/_config.yml
devfyne-jekyll | Dependency Error: Yikes! It looks like you don't have jekyll-redirect-from or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll-redirect-from' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
devfyne-jekyll | jekyll 3.9.0 | Error: jekyll-redirect-from
devfyne-jekyll | /usr/local/bundle/gems/jekyll-3.9.0/lib/jekyll/external.rb:68:in `rescue in block in require_with_graceful_fail': jekyll-redirect-from (Jekyll::Errors::MissingDependencyException)
on my local ubuntu:
Incremental build: disabled. Enable with --incremental
Generating...
GitHub Metadata: No GitHub API authentication could be found. Some fields may be missing or have incorrect data.
done in 149.233 seconds.
jekyll 3.9.0 | Error: no implicit conversion of Hash into Integer
/var/lib/gems/3.0.0/gems/pathutil-0.16.2/lib/pathutil.rb:502:in `read': no implicit conversion of Hash into Integer (TypeError)
On mobile devices page https://developer.fyne.io/ div "intro row" overflows horizontally if screen width is less than 675. This is most likely caused by div.intro-row
having flex-flow
with no-wrap
property.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.