-
-
Save haroldadmin/73dc2ca674aaf566c02fe66109b2f859 to your computer and use it in GitHub Desktop.
A small app written using Fyne to show the current PATH value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"fyne.io/fyne" | |
"fyne.io/fyne/app" | |
"fyne.io/fyne/widget" | |
"github.com/haroldadmin/pathfix" | |
) | |
func main() { | |
app := app.New() | |
w := app.NewWindow("PATH Demo") | |
w.Resize(fyne.NewSize(800, 300)) | |
path := os.Getenv("PATH") | |
label := widget.NewLabel(path) | |
label.Wrapping = fyne.TextWrapBreak | |
w.SetContent(widget.NewVBox( | |
label, | |
widget.NewButton("Refresh", func() { | |
err := pathfix.Fix() | |
if err != nil { | |
fmt.Println(err) | |
} | |
newPath := os.Getenv("PATH") | |
label.Text = newPath | |
label.Refresh() | |
}), | |
)) | |
w.ShowAndRun() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment