Skip to content

Commit

Permalink
Merge pull request #20 from Jacalz/canvas-calls
Browse files Browse the repository at this point in the history
Remove duplicated calls to c.window.Canvas()
  • Loading branch information
Jacalz committed Jun 26, 2022
2 parents 20a3e81 + 443a444 commit 3ba97a0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions calc.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,11 @@ func (c *calc) loadUI(app fyne.App) {
equals)),
)

c.window.Canvas().SetOnTypedRune(c.onTypedRune)
c.window.Canvas().SetOnTypedKey(c.onTypedKey)
c.window.Canvas().AddShortcut(&fyne.ShortcutCopy{}, c.onCopyShortcut)
c.window.Canvas().AddShortcut(&fyne.ShortcutPaste{}, c.onPasteShortcut)
canvas := c.window.Canvas()
canvas.SetOnTypedRune(c.onTypedRune)
canvas.SetOnTypedKey(c.onTypedKey)
canvas.AddShortcut(&fyne.ShortcutCopy{}, c.onCopyShortcut)
canvas.AddShortcut(&fyne.ShortcutPaste{}, c.onPasteShortcut)
c.window.Resize(fyne.NewSize(200, 300))
c.window.Show()
}
Expand Down

0 comments on commit 3ba97a0

Please sign in to comment.