summaryrefslogtreecommitdiff
path: root/draw.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-15 19:24:48 -0600
committerJeff Carr <[email protected]>2024-01-15 19:24:48 -0600
commitfdac7e7b8944d51b8207c1797edd0be9450de7b8 (patch)
tree9e762c05ea6f716dc9434dae1e852630bd6c0ec5 /draw.go
parent94aa368cff322e667156571638a45bd3117a2739 (diff)
restore the files after garbage collectionv0.5.5
hopefully this actually is a valid git repo
Diffstat (limited to 'draw.go')
-rw-r--r--draw.go37
1 files changed, 37 insertions, 0 deletions
diff --git a/draw.go b/draw.go
new file mode 100644
index 0000000..1d5e591
--- /dev/null
+++ b/draw.go
@@ -0,0 +1,37 @@
+// This creates a simple hello world window
+package linuxstatus
+
+import (
+ "go.wit.com/gui/gadgets"
+)
+
+// creates the actual widgets.
+// it's assumed you are always passing in a box
+func draw(ls *LinuxStatus) {
+ if ! ls.Ready() {return}
+ ls.group = ls.window.Box().NewGroup("What Linux Knows It Is")
+
+ ls.grid = ls.group.NewGrid("gridnuts", 2, 2)
+
+ ls.hostnameStatus = gadgets.NewOneLiner(ls.grid, "status")
+ ls.hostname = gadgets.NewOneLiner(ls.grid, "hostname -f")
+ ls.hostshort = gadgets.NewOneLiner(ls.grid, "hostname -s")
+ ls.domainname = gadgets.NewOneLiner(ls.grid, "domain name")
+ ls.resolver = gadgets.NewOneLiner(ls.grid, "nameservers =")
+ ls.resolver.Set("TODO")
+ ls.uid = gadgets.NewOneLiner(ls.grid, "UID =")
+ ls.IPv4 = gadgets.NewOneLiner(ls.grid, "Current IPv4 =")
+ ls.IPv6 = gadgets.NewOneLiner(ls.grid, "Current IPv6 =")
+ ls.workingIPv4 = gadgets.NewOneLiner(ls.grid, "Real IPv4 =")
+ ls.workingIPv6 = gadgets.NewOneLiner(ls.grid, "Real IPv6 =")
+ // ls.nics = gadgets.NewOneLiner(ls.grid, "network intefaces =")
+
+ ls.grid.NewLabel("interfaces =")
+ ls.Interfaces = ls.grid.NewCombobox("Interfaces")
+
+ ls.speed = gadgets.NewOneLiner(ls.grid, "refresh speed =")
+ ls.speedActual = gadgets.NewOneLiner(ls.grid, "refresh speed =")
+
+ ls.grid.Margin()
+ ls.grid.Pad()
+}