Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in 2.2.2 : Preferences are not parsed at program start #3125

Closed
matwachich opened this issue Jul 6, 2022 · 1 comment
Closed
Labels
unverified A bug that has been reported but not verified

Comments

@matwachich
Copy link
Contributor

Describe the bug:

Preferences are not read at program startup. Was working just fine in 2.2.1

To Reproduce:

Run the example program, set some preferences keys/vals. Then restart the program and try to read the keys set before : you get nothing!

Example code:

package main

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

func main() {
	a := app.NewWithID("com.example.app")
	w := a.NewWindow("Test")

	key := widget.NewEntry()
	val := widget.NewEntry()

	w.SetContent(container.NewVBox(key, val, container.NewGridWithColumns(2,
		widget.NewButton("Set", func() {
			a.Preferences().SetString(key.Text, val.Text)
		}),
		widget.NewButton("Get", func() {
			val.SetText(a.Preferences().String(key.Text))
		}),
	)))

	w.ShowAndRun()
}

Device (please complete the following information):

  • OS: Windows 10
  • Go version: 1.18.2
  • Fyne version: 2.2.2
@matwachich matwachich added the unverified A bug that has been reported but not verified label Jul 6, 2022
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jul 6, 2022
Add a test to make sure it doesn't happen again.
Fixes fyne-io#3125
andydotxyz added a commit that referenced this issue Jul 6, 2022
Add a test to make sure it doesn't happen again.
Fixes #3125
@andydotxyz
Copy link
Member

Resolved ready for a speedy v2.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

No branches or pull requests

2 participants