Skip to content

Commit

Permalink
fyne.currentApp()
Browse files Browse the repository at this point in the history
  • Loading branch information
wangbjun committed Jul 13, 2021
1 parent b2108f8 commit 61aca52
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
)

type App struct {
fyne fyne.App
window fyne.Window
entry *widget.Entry
button *widget.Button
Expand All @@ -31,7 +30,6 @@ func New() *App {
a := app.NewWithID("catya")
a.Settings().SetTheme(&theme.MyTheme{})
return &App{
fyne: a,
api: api.New(),
dataList: []string{},
window: a.NewWindow("Catya"),
Expand Down Expand Up @@ -164,11 +162,11 @@ func (app *App) saveRecent() {
if err != nil {
return
}
app.fyne.Preferences().SetString("recents", string(text))
fyne.CurrentApp().Preferences().SetString("recents", string(text))
}

func (app *App) loadRecent() ([]string, error) {
recents := app.fyne.Preferences().String("recents")
recents := fyne.CurrentApp().Preferences().String("recents")
var content []string
err := json.Unmarshal([]byte(recents), &content)
if err != nil {
Expand Down

0 comments on commit 61aca52

Please sign in to comment.