diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-12-31 17:32:43 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.xyz> | 2022-12-31 17:32:43 +0530 |
commit | 2b0edbefb6664fc7f54eb3c321d945a44fce1205 (patch) | |
tree | c05e4f331f73902d6021ef0936f9317b92ed8df7 /main.go | |
parent | f40159390084a91ad81b8b6bff0e992477cdc106 (diff) |
added folder picker
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -57,6 +57,9 @@ func onActivate(app *gtk.Application) { dirInput, _ := gtk.EntryNew() dirInput.SetText(DEFAULT_DIR) dirBox.PackEnd(dirInput, false, false, 5) + + browseButton, _ := gtk.FileChooserButtonNew("Browse", gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER) + dirBox.PackEnd(browseButton, false, false, 5) box.PackStart(dirBox, false, false, 5) portBox, _ := gtk.BoxNew(gtk.ORIENTATION_HORIZONTAL, 0) @@ -76,6 +79,10 @@ func onActivate(app *gtk.Application) { statusLabel, _ := gtk.LabelNew("") box.PackStart(statusLabel, false, true, 10) + browseButton.Connect("selection-changed", func() { + dirInput.SetText(browseButton.GetFilename()) + }) + var on = false var server *http.Server buttonSwitch.Connect("toggled", func() { |