1 Commits

Author SHA1 Message Date
97c58d7fc4 fltk: initial commit 2024-07-18 17:01:02 +12:00
3 changed files with 50 additions and 0 deletions

47
fltktest/main.go Normal file
View File

@@ -0,0 +1,47 @@
package main
import (
"github.com/pwiecz/go-fltk"
)
const WNDCOLOR = 0xf0f0f000
const FONTSIZE = 12
func main() {
fltk.SetScheme("gtk+")
// ourFont := fltk.FREE_FONT + 1
// fltk.SetFont(ourFont, "Papyrus")
fltk.SetColor(fltk.BACKGROUND_COLOR, 0xf0, 0xf0, 0xf0)
fltk.SetColor(fltk.BACKGROUND2_COLOR, 0xff, 0x00, 0x00)
win := fltk.NewWindow(400, 300)
win.SetLabel("Main Window")
// win.SetLabelSize(FONTSIZE)
// win.SetColor(WNDCOLOR)
mnu := fltk.NewMenuBar(0, 0, win.W(), 25)
mnu.Add("File/Quit", func() {})
mnu.SetLabelSize(FONTSIZE)
mnu.SetBox(fltk.FLAT_BOX)
win.Add(mnu)
btn := fltk.NewButton(160, 200, 80, 30, "Click")
// btn.SetLabelFont(ourFont)
btn.SetLabelSize(FONTSIZE)
btn.SetCallback(func() {
btn.SetLabel("Clicked")
})
// win.End()
// win.Resizable()
win.SetResizeHandler(func() {
mnu.Resize(0, 0, win.W(), 25)
})
win.Show()
fltk.Run()
}

1
go.mod
View File

@@ -45,6 +45,7 @@ require (
github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a // indirect
github.com/prometheus/common v0.32.1 // indirect
github.com/prometheus/procfs v0.7.3 // indirect
github.com/pwiecz/go-fltk v0.0.0-20240525043121-5313f8a5a643 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
go.opencensus.io v0.22.5 // indirect

2
go.sum
View File

@@ -239,6 +239,8 @@ github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4O
github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU=
github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA=
github.com/pwiecz/go-fltk v0.0.0-20240525043121-5313f8a5a643 h1:t1fpLVVcboeJvXMiwMCpF1MBiQGg7VyTBqjLEEe+qXM=
github.com/pwiecz/go-fltk v0.0.0-20240525043121-5313f8a5a643/go.mod h1:uMK5daOr9p+ba2BPs5QadbfaqqrHR5TGj13yWGsAsmw=
github.com/redis/go-redis/v9 v9.5.3 h1:fOAp1/uJG+ZtcITgZOfYFmTKPE7n4Vclj1wZFgRciUU=
github.com/redis/go-redis/v9 v9.5.3/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=