Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Oct 8, 2023
1 parent a0046c1 commit fe06789
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions example/basic_usage.v
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ fn main() {
mut tray := vtray.create(icon, tooltip: 'VTray Demo!')
tray.add_item('Edit',
checkable: true
on_click: fn [tray] () {
if x := tray.get_item('Edit') {
if x.checked {
tray.set_icon('${@VMODROOT}/assets/test.ico')
} else {
tray.set_icon('${@VMODROOT}/assets/icon.ico')
}
on_click: fn [tray] (item &vtray.MenuItem) {
if item.checked {
tray.set_icon('${@VMODROOT}/assets/test.ico')
} else {
tray.set_icon('${@VMODROOT}/assets/icon.ico')
}
}
)
Expand Down

0 comments on commit fe06789

Please sign in to comment.