From 90a1f5d1d5e3cd62e7ca125d20a6731af8f1d2aa Mon Sep 17 00:00:00 2001 From: WMYeah_Mac Date: Fri, 14 Jun 2024 18:28:24 +0800 Subject: [PATCH] Update v0.0.16 --- README.md | 32 +++++++++++++-------------- README_zh-cn.md | 32 +++++++++++++-------------- cgo_darwin_arm64.go | 3 +-- config/config.go | 2 +- examples/7GUIs/cells/main.go | 4 +--- examples/7GUIs/cells/panel.go | 5 ++--- examples/7GUIs/circle/main.go | 4 +--- examples/7GUIs/circle/panel.go | 3 +-- examples/7GUIs/counter/main.go | 3 +-- examples/7GUIs/crud/main.go | 3 +-- examples/7GUIs/flightbooker/main.go | 3 +-- examples/7GUIs/temperature/main.go | 3 +-- examples/7GUIs/timer/main.go | 3 +-- examples/chart/main.go | 3 +-- examples/choice/main.go | 1 - examples/custom-dial/main.go | 3 +-- examples/dnd/main.go | 1 - examples/flex/main.go | 3 +-- examples/flutter-like/main.go | 3 +-- examples/grid/main.go | 4 +++- examples/group/main.go | 3 +-- examples/helpview/main.go | 1 - examples/icons/main.go | 3 +-- examples/image/main.go | 1 - examples/mdviewer/go.mod | 9 ++++---- examples/native_file_chooser/main.go | 1 - examples/opengl/go.mod | 4 ++-- examples/opengl/go.sum | 2 -- examples/opengl/main.go | 2 +- examples/paint/main.go | 4 +--- examples/rgb_image/main.go | 3 +-- examples/styled_text/main.go | 3 +-- examples/svg/main.go | 1 - examples/table/main.go | 1 - examples/tabs/main.go | 4 +--- examples/texteditor/main.go | 3 +-- examples/timeout/main.go | 1 - examples/toggle/main.go | 4 +--- examples/ui-config-grid/main.go | 3 +-- examples/ui-config/main.go | 3 +-- examples/widget_table/main.go | 4 +--- examples/wizard/main.go | 4 +--- fltk-build.go | 31 ++++++++++++-------------- fltk_go.go | 5 ----- lib/darwin/amd64/libfltk.a | Bin 2445576 -> 2445576 bytes lib/darwin/amd64/libfltk_forms.a | Bin 36336 -> 36336 bytes lib/darwin/amd64/libfltk_gl.a | Bin 250568 -> 250568 bytes lib/darwin/amd64/libfltk_images.a | Bin 300248 -> 300248 bytes lib/darwin/amd64/libfltk_jpeg.a | Bin 404144 -> 404144 bytes lib/darwin/amd64/libfltk_png.a | Bin 326792 -> 326792 bytes lib/darwin/amd64/libfltk_z.a | Bin 123984 -> 123984 bytes menu.go | 4 ++-- text.go | 4 ++-- 53 files changed, 89 insertions(+), 137 deletions(-) diff --git a/README.md b/README.md index d69d197..37c88d4 100644 --- a/README.md +++ b/README.md @@ -105,29 +105,29 @@ const HEIGHT = 400 func main() { curr := 0 -fltk.InitStyles() -win := fltk.NewWindow(WIDTH, HEIGHT) +fltk_go.InitStyles() +win := fltk_go.NewWindow(WIDTH, HEIGHT) win.SetLabel("Flutter-like") -win.SetColor(fltk.WHITE) -bar := fltk.NewBox(fltk.FLAT_BOX, 0, 0, WIDTH, 60, " FLTK App!") +win.SetColor(fltk_go.WHITE) +bar := fltk_go.NewBox(fltk_go.FLAT_BOX, 0, 0, WIDTH, 60, " FLTK App!") bar.SetDrawHandler(func() { // Shadow under the bar -fltk.DrawBox(fltk.FLAT_BOX, 0, 0, WIDTH, 63, LIGHT_GRAY) +fltk_go.DrawBox(fltk_go.FLAT_BOX, 0, 0, WIDTH, 63, LIGHT_GRAY) }) -bar.SetAlign(fltk.ALIGN_INSIDE | fltk.ALIGN_LEFT) +bar.SetAlign(fltk_go.ALIGN_INSIDE | fltk_go.ALIGN_LEFT) bar.SetLabelColor(255) // this uses the index into the color map, here it's white bar.SetColor(BLUE) bar.SetLabelSize(22) -text := fltk.NewBox(fltk.NO_BOX, 250, 180, 100, 40, "You have pushed the button this many times:") +text := fltk_go.NewBox(fltk_go.NO_BOX, 250, 180, 100, 40, "You have pushed the button this many times:") text.SetLabelSize(18) -text.SetLabelFont(fltk.TIMES) -count := fltk.NewBox(fltk.NO_BOX, 250, 180+40, 100, 40, "0") +text.SetLabelFont(fltk_go.TIMES) +count := fltk_go.NewBox(fltk_go.NO_BOX, 250, 180+40, 100, 40, "0") count.SetLabelSize(36) count.SetLabelColor(GRAY) -btn := fltk.NewButton(WIDTH-100, HEIGHT-100, 60, 60, "@+6plus") // This translates to a plus sign +btn := fltk_go.NewButton(WIDTH-100, HEIGHT-100, 60, 60, "@+6plus") // This translates to a plus sign btn.SetColor(BLUE) btn.SetSelectionColor(SEL_BLUE) btn.SetLabelColor(255) -btn.SetBox(fltk.OFLAT_BOX) +btn.SetBox(fltk_go.OFLAT_BOX) btn.ClearVisibleFocus() btn.SetCallback(func() { curr += 1 @@ -135,7 +135,7 @@ count.SetLabel(strconv.Itoa(curr)) }) win.End() win.Show() -fltk.Run() +fltk_go.Run() } ``` @@ -162,9 +162,9 @@ import ( "github.com/george012/fltk_go" func main() { -win := fltk.NewWindow(400, 300) -box := fltk.NewBox(fltk.FLAT_BOX, 0, 0, 400, 300, "") -image, err := fltk.NewJpegImageLoad("image.jpg") +win := fltk_go.NewWindow(400, 300) +box := fltk_go.NewBox(fltk_go.FLAT_BOX, 0, 0, 400, 300, "") +image, err := fltk_go.NewJpegImageLoad("image.jpg") if err != nil { fmt.Printf("An error occurred: %s\n", err) } else { @@ -172,7 +172,7 @@ box.SetImage(image) } win.End() win.Show() -fltk.Run() +fltk_go.Run() } ``` diff --git a/README_zh-cn.md b/README_zh-cn.md index b2eeba7..b89bee8 100644 --- a/README_zh-cn.md +++ b/README_zh-cn.md @@ -105,29 +105,29 @@ const HEIGHT = 400 func main() { curr := 0 - fltk.InitStyles() - win := fltk.NewWindow(WIDTH, HEIGHT) + fltk_go.InitStyles() + win := fltk_go.NewWindow(WIDTH, HEIGHT) win.SetLabel("Flutter-like") - win.SetColor(fltk.WHITE) - bar := fltk.NewBox(fltk.FLAT_BOX, 0, 0, WIDTH, 60, " FLTK App!") + win.SetColor(fltk_go.WHITE) + bar := fltk_go.NewBox(fltk_go.FLAT_BOX, 0, 0, WIDTH, 60, " FLTK App!") bar.SetDrawHandler(func() { // Shadow under the bar - fltk.DrawBox(fltk.FLAT_BOX, 0, 0, WIDTH, 63, LIGHT_GRAY) + fltk_go.DrawBox(fltk_go.FLAT_BOX, 0, 0, WIDTH, 63, LIGHT_GRAY) }) - bar.SetAlign(fltk.ALIGN_INSIDE | fltk.ALIGN_LEFT) + bar.SetAlign(fltk_go.ALIGN_INSIDE | fltk_go.ALIGN_LEFT) bar.SetLabelColor(255) // this uses the index into the color map, here it's white bar.SetColor(BLUE) bar.SetLabelSize(22) - text := fltk.NewBox(fltk.NO_BOX, 250, 180, 100, 40, "You have pushed the button this many times:") + text := fltk_go.NewBox(fltk_go.NO_BOX, 250, 180, 100, 40, "You have pushed the button this many times:") text.SetLabelSize(18) - text.SetLabelFont(fltk.TIMES) - count := fltk.NewBox(fltk.NO_BOX, 250, 180+40, 100, 40, "0") + text.SetLabelFont(fltk_go.TIMES) + count := fltk_go.NewBox(fltk_go.NO_BOX, 250, 180+40, 100, 40, "0") count.SetLabelSize(36) count.SetLabelColor(GRAY) - btn := fltk.NewButton(WIDTH-100, HEIGHT-100, 60, 60, "@+6plus") // 这翻译成一个加号 + btn := fltk_go.NewButton(WIDTH-100, HEIGHT-100, 60, 60, "@+6plus") // 这翻译成一个加号 btn.SetColor(BLUE) btn.SetSelectionColor(SEL_BLUE) btn.SetLabelColor(255) - btn.SetBox(fltk.OFLAT_BOX) + btn.SetBox(fltk_go.OFLAT_BOX) btn.ClearVisibleFocus() btn.SetCallback(func() { curr += 1 @@ -135,7 +135,7 @@ func main() { }) win.End() win.Show() - fltk.Run() + fltk_go.Run() } ``` @@ -163,9 +163,9 @@ import ( ) func main() { - win := fltk.NewWindow(400, 300) - box := fltk.NewBox(fltk.FLAT_BOX, 0, 0, 400, 300, "") - image, err := fltk.NewJpegImageLoad("image.jpg") + win := fltk_go.NewWindow(400, 300) + box := fltk_go.NewBox(fltk_go.FLAT_BOX, 0, 0, 400, 300, "") + image, err := fltk_go.NewJpegImageLoad("image.jpg") if err != nil { fmt.Printf("An error occured: %s\n", err) } else { @@ -173,7 +173,7 @@ func main() { } win.End() win.Show() - fltk.Run() + fltk_go.Run() } ``` diff --git a/cgo_darwin_arm64.go b/cgo_darwin_arm64.go index a8048a4..18062ef 100644 --- a/cgo_darwin_arm64.go +++ b/cgo_darwin_arm64.go @@ -1,9 +1,8 @@ //go:build darwin && arm64 -// +build darwin,arm64 package fltk_go // #cgo darwin,arm64 CXXFLAGS: -std=c++11 -// #cgo darwin,arm64 CPPFLAGS: -I${SRCDIR}/lib/darwin/arm64 -I${SRCDIR}/include -I${SRCDIR}/include/FL/images -I${SRCDIR}/include/png -I${SRCDIR}/include/zlib -I${SRCDIR}/include/jpeg -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT +// #cgo darwin,arm64 CPPFLAGS: -I${SRCDIR}/lib/darwin/arm64 -I${SRCDIR}/include -I${SRCDIR}/include/FL/images -I${SRCDIR}/include/png -I${SRCDIR}/include/zlib -I${SRCDIR}/include/jpeg -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.3.sdk -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_THREAD_SAFE -D_REENTRANT // #cgo darwin,arm64 LDFLAGS: ${SRCDIR}/lib/darwin/arm64/libfltk_images.a ${SRCDIR}/lib/darwin/arm64/libfltk_jpeg.a ${SRCDIR}/lib/darwin/arm64/libfltk_png.a ${SRCDIR}/lib/darwin/arm64/libfltk_z.a ${SRCDIR}/lib/darwin/arm64/libfltk_gl.a -framework OpenGL ${SRCDIR}/lib/darwin/arm64/libfltk_forms.a ${SRCDIR}/lib/darwin/arm64/libfltk.a -lm -lpthread -framework Cocoa import "C" diff --git a/config/config.go b/config/config.go index 1bcbb2a..3c6b605 100644 --- a/config/config.go +++ b/config/config.go @@ -2,5 +2,5 @@ package config const ( ProjectName = "fltk_go" - ProjectVersion = "v0.0.15" + ProjectVersion = "v0.0.16" ) diff --git a/examples/7GUIs/cells/main.go b/examples/7GUIs/cells/main.go index d40b11e..263e52f 100644 --- a/examples/7GUIs/cells/main.go +++ b/examples/7GUIs/cells/main.go @@ -1,8 +1,6 @@ package main -import ( - "github.com/george012/fltk_go" -) +import "github.com/george012/fltk_go" const ( WIDGET_HEIGHT = 200 diff --git a/examples/7GUIs/cells/panel.go b/examples/7GUIs/cells/panel.go index 491376a..30ae88b 100644 --- a/examples/7GUIs/cells/panel.go +++ b/examples/7GUIs/cells/panel.go @@ -1,9 +1,8 @@ package main import ( - "log" - "github.com/george012/fltk_go" + "log" ) type Panel struct { @@ -76,7 +75,7 @@ func (p *Panel) Bind(ctx *Context) { } }) - // p.tb.SetCallbackCondition(fltk_go.WhenNotChanged) + // p.tb.SetCallbackCondition(fltk.WhenNotChanged) p.tb.SetCallback(func() { tc := p.tb.CallbackContext() if tc != fltk_go.ContextCell { diff --git a/examples/7GUIs/circle/main.go b/examples/7GUIs/circle/main.go index 641084f..398f830 100644 --- a/examples/7GUIs/circle/main.go +++ b/examples/7GUIs/circle/main.go @@ -1,8 +1,6 @@ package main -import ( - "github.com/george012/fltk_go" -) +import "github.com/george012/fltk_go" const ( WIDGET_HEIGHT = 25 diff --git a/examples/7GUIs/circle/panel.go b/examples/7GUIs/circle/panel.go index c75b3d3..e61163b 100644 --- a/examples/7GUIs/circle/panel.go +++ b/examples/7GUIs/circle/panel.go @@ -2,9 +2,8 @@ package main import ( "fmt" - "runtime" - "github.com/george012/fltk_go" + "runtime" ) type Panel struct { diff --git a/examples/7GUIs/counter/main.go b/examples/7GUIs/counter/main.go index e0b336c..7f44dab 100644 --- a/examples/7GUIs/counter/main.go +++ b/examples/7GUIs/counter/main.go @@ -1,9 +1,8 @@ package main import ( - "strconv" - "github.com/george012/fltk_go" + "strconv" ) const ( diff --git a/examples/7GUIs/crud/main.go b/examples/7GUIs/crud/main.go index 2954add..9a5faf2 100644 --- a/examples/7GUIs/crud/main.go +++ b/examples/7GUIs/crud/main.go @@ -2,10 +2,9 @@ package main import ( "fmt" + "github.com/george012/fltk_go" "log" "strings" - - "github.com/george012/fltk_go" ) const ( diff --git a/examples/7GUIs/flightbooker/main.go b/examples/7GUIs/flightbooker/main.go index 5ce9582..138f18d 100644 --- a/examples/7GUIs/flightbooker/main.go +++ b/examples/7GUIs/flightbooker/main.go @@ -2,9 +2,8 @@ package main import ( "fmt" - "time" - "github.com/george012/fltk_go" + "time" ) const ( diff --git a/examples/7GUIs/temperature/main.go b/examples/7GUIs/temperature/main.go index cbe3e3e..3ec69d7 100644 --- a/examples/7GUIs/temperature/main.go +++ b/examples/7GUIs/temperature/main.go @@ -1,10 +1,9 @@ package main import ( + "github.com/george012/fltk_go" "log" "strconv" - - "github.com/george012/fltk_go" ) const ( diff --git a/examples/7GUIs/timer/main.go b/examples/7GUIs/timer/main.go index 2048025..2663511 100644 --- a/examples/7GUIs/timer/main.go +++ b/examples/7GUIs/timer/main.go @@ -1,9 +1,8 @@ package main import ( - "time" - "github.com/george012/fltk_go" + "time" ) const ( diff --git a/examples/chart/main.go b/examples/chart/main.go index c7dbe7b..aa2050e 100644 --- a/examples/chart/main.go +++ b/examples/chart/main.go @@ -1,10 +1,9 @@ package main import ( + "github.com/george012/fltk_go" "math/rand" "strconv" - - "github.com/george012/fltk_go" ) func main() { diff --git a/examples/choice/main.go b/examples/choice/main.go index 5772184..c2c2b6a 100644 --- a/examples/choice/main.go +++ b/examples/choice/main.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "github.com/george012/fltk_go" ) diff --git a/examples/custom-dial/main.go b/examples/custom-dial/main.go index d47cff3..9f3d9cf 100644 --- a/examples/custom-dial/main.go +++ b/examples/custom-dial/main.go @@ -1,9 +1,8 @@ package main import ( - "strconv" - "github.com/george012/fltk_go" + "strconv" ) type MyDial struct { diff --git a/examples/dnd/main.go b/examples/dnd/main.go index 95af188..a7e486c 100644 --- a/examples/dnd/main.go +++ b/examples/dnd/main.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "github.com/george012/fltk_go" ) diff --git a/examples/flex/main.go b/examples/flex/main.go index 962eaea..e3ab21a 100644 --- a/examples/flex/main.go +++ b/examples/flex/main.go @@ -1,9 +1,8 @@ package main import ( - "strconv" - "github.com/george012/fltk_go" + "strconv" ) var i = 0 diff --git a/examples/flutter-like/main.go b/examples/flutter-like/main.go index 91e6621..f9bfa5f 100644 --- a/examples/flutter-like/main.go +++ b/examples/flutter-like/main.go @@ -1,9 +1,8 @@ package main import ( - "strconv" - "github.com/george012/fltk_go" + "strconv" ) // FLTK uses an RGBI color representation, the I is an index into FLTK's color map diff --git a/examples/grid/main.go b/examples/grid/main.go index 1786fa2..a69f7ca 100644 --- a/examples/grid/main.go +++ b/examples/grid/main.go @@ -1,6 +1,8 @@ package main -import "github.com/george012/fltk_go" +import ( + "github.com/george012/fltk_go" +) func main() { win := fltk_go.NewWindow(320, 180) diff --git a/examples/group/main.go b/examples/group/main.go index 8e33364..85d56d8 100644 --- a/examples/group/main.go +++ b/examples/group/main.go @@ -2,9 +2,8 @@ package main import ( "fmt" - "runtime" - "github.com/george012/fltk_go" + "runtime" ) func main() { diff --git a/examples/helpview/main.go b/examples/helpview/main.go index b13784a..f945ba6 100644 --- a/examples/helpview/main.go +++ b/examples/helpview/main.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "github.com/george012/fltk_go" ) diff --git a/examples/icons/main.go b/examples/icons/main.go index eae2204..469b3bd 100644 --- a/examples/icons/main.go +++ b/examples/icons/main.go @@ -3,11 +3,10 @@ package main import ( "bytes" _ "embed" + "github.com/george012/fltk_go" "image" _ "image/png" "runtime" - - "github.com/george012/fltk_go" ) //go:embed 8x8.png diff --git a/examples/image/main.go b/examples/image/main.go index d9bbd36..4142e13 100644 --- a/examples/image/main.go +++ b/examples/image/main.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "github.com/george012/fltk_go" ) diff --git a/examples/mdviewer/go.mod b/examples/mdviewer/go.mod index 6030f71..b1c5a3a 100644 --- a/examples/mdviewer/go.mod +++ b/examples/mdviewer/go.mod @@ -1,9 +1,10 @@ module github.com/george012/fltk_go/examples/mdviewer -go 1.17 +go 1.18 replace github.com/george012/fltk_go => ../../ -require github.com/george012/fltk_go v0.0.0 - -require github.com/yuin/goldmark v1.4.14 +require ( + github.com/george012/fltk_go v0.0.1 + github.com/yuin/goldmark v1.4.14 +) diff --git a/examples/native_file_chooser/main.go b/examples/native_file_chooser/main.go index 742c584..cfa0bda 100644 --- a/examples/native_file_chooser/main.go +++ b/examples/native_file_chooser/main.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "github.com/george012/fltk_go" ) diff --git a/examples/opengl/go.mod b/examples/opengl/go.mod index 54d4d14..e6bffbd 100644 --- a/examples/opengl/go.mod +++ b/examples/opengl/go.mod @@ -3,8 +3,8 @@ module github.com/george012/fltk_go/examples/opengl go 1.17 require ( + github.com/george012/fltk_go v0.0.1 github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 - github.com/george012/fltk_go v0.0.0-20220723095549-2020b5635372 ) -replace github.com/george012/fltk_go => ../../ \ No newline at end of file +replace github.com/george012/fltk_go => ../../ diff --git a/examples/opengl/go.sum b/examples/opengl/go.sum index 18d9496..6cc81c7 100644 --- a/examples/opengl/go.sum +++ b/examples/opengl/go.sum @@ -1,4 +1,2 @@ github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6 h1:zDw5v7qm4yH7N8C8uWd+8Ii9rROdgWxQuGoJ9WDXxfk= github.com/go-gl/gl v0.0.0-20211210172815-726fda9656d6/go.mod h1:9YTyiznxEY1fVinfM7RvRcjRHbw2xLBJ3AAGIT0I4Nw= -github.com/pwiecz/go-fltk v0.0.0-20220723095549-2020b5635372 h1:HU+jfecrJQmFEYFiHQExT0sKuOvHcGaucXrYh5+SM3A= -github.com/pwiecz/go-fltk v0.0.0-20220723095549-2020b5635372/go.mod h1:uMK5daOr9p+ba2BPs5QadbfaqqrHR5TGj13yWGsAsmw= diff --git a/examples/opengl/main.go b/examples/opengl/main.go index 0d4d8c9..dd451af 100644 --- a/examples/opengl/main.go +++ b/examples/opengl/main.go @@ -1,10 +1,10 @@ package main import ( + "github.com/george012/fltk_go" "log" "runtime" - "github.com/george012/fltk_go" "github.com/go-gl/gl/v2.1/gl" ) diff --git a/examples/paint/main.go b/examples/paint/main.go index 74bf869..f91794d 100644 --- a/examples/paint/main.go +++ b/examples/paint/main.go @@ -1,8 +1,6 @@ package main -import ( - "github.com/george012/fltk_go" -) +import "github.com/george012/fltk_go" func main() { win := fltk_go.NewWindow(800, 600) diff --git a/examples/rgb_image/main.go b/examples/rgb_image/main.go index 0876286..8a44ad8 100644 --- a/examples/rgb_image/main.go +++ b/examples/rgb_image/main.go @@ -1,10 +1,9 @@ package main import ( + "github.com/george012/fltk_go" goimage "image" "image/color" - - "github.com/george012/fltk_go" ) func main() { diff --git a/examples/styled_text/main.go b/examples/styled_text/main.go index da8168c..5565f91 100644 --- a/examples/styled_text/main.go +++ b/examples/styled_text/main.go @@ -1,9 +1,8 @@ package main import ( - "strings" - "github.com/george012/fltk_go" + "strings" ) func main() { diff --git a/examples/svg/main.go b/examples/svg/main.go index dbac414..436fdd9 100644 --- a/examples/svg/main.go +++ b/examples/svg/main.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "github.com/george012/fltk_go" ) diff --git a/examples/table/main.go b/examples/table/main.go index 7ecb9fa..0b5718e 100644 --- a/examples/table/main.go +++ b/examples/table/main.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "github.com/george012/fltk_go" ) diff --git a/examples/tabs/main.go b/examples/tabs/main.go index cd7c359..12b56e4 100644 --- a/examples/tabs/main.go +++ b/examples/tabs/main.go @@ -1,8 +1,6 @@ package main -import ( - "github.com/george012/fltk_go" -) +import "github.com/george012/fltk_go" func main() { win := fltk_go.NewWindow(300, 200) diff --git a/examples/texteditor/main.go b/examples/texteditor/main.go index d013376..fcda9db 100644 --- a/examples/texteditor/main.go +++ b/examples/texteditor/main.go @@ -2,9 +2,8 @@ package main import ( "fmt" - "os" - "github.com/george012/fltk_go" + "os" ) const ( diff --git a/examples/timeout/main.go b/examples/timeout/main.go index 1d41019..a13d48e 100644 --- a/examples/timeout/main.go +++ b/examples/timeout/main.go @@ -2,7 +2,6 @@ package main import ( "fmt" - "github.com/george012/fltk_go" ) diff --git a/examples/toggle/main.go b/examples/toggle/main.go index 71b1766..cb8a81a 100644 --- a/examples/toggle/main.go +++ b/examples/toggle/main.go @@ -1,8 +1,6 @@ package main -import ( - "github.com/george012/fltk_go" -) +import "github.com/george012/fltk_go" type MyToggleButton struct { btn *fltk_go.ToggleButton diff --git a/examples/ui-config-grid/main.go b/examples/ui-config-grid/main.go index 96664d1..9175be2 100644 --- a/examples/ui-config-grid/main.go +++ b/examples/ui-config-grid/main.go @@ -1,10 +1,9 @@ package main import ( + "github.com/george012/fltk_go" "os" "strings" - - "github.com/george012/fltk_go" ) const ( diff --git a/examples/ui-config/main.go b/examples/ui-config/main.go index d2e7417..322978e 100644 --- a/examples/ui-config/main.go +++ b/examples/ui-config/main.go @@ -1,9 +1,8 @@ package main import ( - "strings" - "github.com/george012/fltk_go" + "strings" ) const ( diff --git a/examples/widget_table/main.go b/examples/widget_table/main.go index 1824b62..76a10f7 100644 --- a/examples/widget_table/main.go +++ b/examples/widget_table/main.go @@ -1,8 +1,6 @@ package main -import ( - "github.com/george012/fltk_go" -) +import "github.com/george012/fltk_go" func main() { win := fltk_go.NewWindow(300, 200) diff --git a/examples/wizard/main.go b/examples/wizard/main.go index fb3d48f..2416a4d 100644 --- a/examples/wizard/main.go +++ b/examples/wizard/main.go @@ -1,8 +1,6 @@ package main -import ( - "github.com/george012/fltk_go" -) +import "github.com/george012/fltk_go" func main() { win := fltk_go.NewWindow(300, 200) diff --git a/fltk-build.go b/fltk-build.go index f69aa11..6357515 100644 --- a/fltk-build.go +++ b/fltk-build.go @@ -122,8 +122,8 @@ func main() { cmakeGenerator = "Unix Makefiles" } - cmakeCmdArgs := []string{ - "-G", cmakeGenerator, "-S", "fltk", "-B", "build", + cmakeCmd := exec.Command( + "cmake", "-G", cmakeGenerator, "-S", "fltk", "-B", "build", "-DCMAKE_BUILD_TYPE=Release", "-DFLTK_BUILD_TEST=OFF", "-DFLTK_BUILD_EXAMPLES=OFF", @@ -133,16 +133,16 @@ func main() { "-DOPTION_USE_SYSTEM_LIBJPEG=OFF", "-DOPTION_USE_SYSTEM_LIBPNG=OFF", "-DOPTION_USE_SYSTEM_ZLIB=OFF", - "-DCMAKE_INSTALL_PREFIX=" + currentDir, + "-DCMAKE_INSTALL_PREFIX="+currentDir, "-DCMAKE_INSTALL_INCLUDEDIR=include", - "-DCMAKE_INSTALL_LIBDIR=" + libdir, - "-DFLTK_INCLUDEDIR=" + filepath.Join(currentDir, "include"), - "-DFLTK_LIBDIR=" + filepath.Join(currentDir, "lib", runtime.GOOS, runtime.GOARCH), - } + "-DCMAKE_INSTALL_LIBDIR="+libdir, + "-DFLTK_INCLUDEDIR="+filepath.Join(currentDir, "include"), + "-DFLTK_LIBDIR="+filepath.Join(currentDir, "lib", runtime.GOOS, runtime.GOARCH)) if runtime.GOOS == "darwin" { - cmakeCmdArgs = append(cmakeCmdArgs, "-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0") - //// Get the SDK path using xcrun + cmakeCmd.Args = append(cmakeCmd.Args, "-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0") + + // Get the SDK path using xcrun //sdkPathCmd := exec.Command("xcrun", "--sdk", "macosx", "--show-sdk-path") //sdkPathOutput, err := sdkPathCmd.Output() //if err != nil { @@ -150,22 +150,19 @@ func main() { // os.Exit(1) //} //sdkPath := strings.TrimSpace(string(sdkPathOutput)) - // - //cmakeCmdArgs = append(cmakeCmdArgs, "-DCMAKE_OSX_SYSROOT="+sdkPath) + //cmakeCmd.Args = append(cmakeCmd.Args, "-DCMAKE_OSX_SYSROOT="+sdkPath) + + cmakeCmd.Args = append(cmakeCmd.Args, "-DCMAKE_OSX_SYSROOT="+"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk") - cmakeCmdArgs = append(cmakeCmdArgs, "-DCMAKE_OSX_SYSROOT="+"/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk") if runtime.GOARCH == "amd64" { - cmakeCmdArgs = append(cmakeCmdArgs, "-DCMAKE_OSX_ARCHITECTURES=x86_64") + cmakeCmd.Args = append(cmakeCmd.Args, "-DCMAKE_OSX_ARCHITECTURES=x86_64") } else if runtime.GOARCH == "arm64" { - cmakeCmdArgs = append(cmakeCmdArgs, "-DCMAKE_OSX_ARCHITECTURES=arm64") + cmakeCmd.Args = append(cmakeCmd.Args, "-DCMAKE_OSX_ARCHITECTURES=arm64") } else { fmt.Printf("Unsupported MacOS architecture, %s\n", runtime.GOARCH) os.Exit(1) } } - - cmakeCmd := exec.Command("cmake", cmakeCmdArgs...) - cmakeCmd.Dir = "fltk_build" cmakeCmd.Stdout = os.Stdout cmakeCmd.Stderr = os.Stderr diff --git a/fltk_go.go b/fltk_go.go index 4ce3727..c1246c9 100644 --- a/fltk_go.go +++ b/fltk_go.go @@ -6,7 +6,6 @@ package fltk_go */ import "C" import ( - "github.com/george012/fltk_go/config" "sync" "unsafe" ) @@ -598,7 +597,3 @@ func Version() string { func GoVersion() string { return "v0.1.0" } - -func VersionByGobind() string { - return config.ProjectVersion -} diff --git a/lib/darwin/amd64/libfltk.a b/lib/darwin/amd64/libfltk.a index 4c466b18c0126148061d1a5c6d51bc6d819ed673..3d10e26464a4af54e10e19e7b7decc4a8665ad6e 100644 GIT binary patch delta 134 zcmWN=$qj-4006-t9(ap_f(L?13nbfxE&14lryt{AYp@Pm(n+R$J%aZCUWCv*t9PE= zkU%;TN>_T)mw`kwl#z^OB2$^kTow|`QdW{kDr?zDCb?{7CwnYktqyPW_ delta 134 zcmWN=Ne;na0D#d{jjfrYhTnVz;yZ;ab@3%#+K9cqrE5ssh?l(bd5_BfTZm7W^W*yp zd4WVykyxryle#pdDJ@APm9})GD?RDUK!!4sv1Brlsmvsoxh!NUD+#iejcjEndpW#0 Gey%^5T_=YC diff --git a/lib/darwin/amd64/libfltk_forms.a b/lib/darwin/amd64/libfltk_forms.a index f1eecd2d0f3a60a0be23ac5d04544abd7a99136b..7b7dcdcdac2d4740214dc0c781c653153e33588d 100644 GIT binary patch delta 17 Zcmew`o9V-BrU`N^mX>D58fw1{t0p{mX>D5jY_RbjIBycTa}oXT>=1n@(9cT delta 26 icmX@Hl>fw1{t0p{W|rnAjY_RbjIBycTa}oXT>=1n+z876 diff --git a/lib/darwin/amd64/libfltk_images.a b/lib/darwin/amd64/libfltk_images.a index 5eeee4c485d595878a4610dc72379bc0e6654150..8046bd779c016def514905110fc524fd37d009b4 100644 GIT binary patch delta 29 lcmcbyQs~A?p$T#D5jY_RbjIByctxC*Wl~}e-0RWmx33mVh delta 29 lcmcbyQs~A?p$T#D5jY_RbjIByctxC+TN-V8PtXq}X`m_Ml6ADrQ delta 35 qcmdmRRbsc!C_WrKQ>QiwcaAjaIEzjICBotyauityuj2007Nz3ts>L delta 33 ocmeD9Dctc>c!C_WnWg!3#Rg`HM$1-9##T$FR!iosmMs2%0LFm}3IG5A diff --git a/lib/darwin/amd64/libfltk_z.a b/lib/darwin/amd64/libfltk_z.a index 653418e9b9ab8f906de179e2cf11c7421c64d7cf..75d7842224b5ee6684eb25ab1e95736c851009aa 100644 GIT binary patch delta 20 ccmca`g8jk?_6c$D5jY?aU81 0 { // Fltk may crash when Popup is called on empty menu. - // https://github.com/george012/fltk_go/issues/64 + // https://github.com/pwiecz/go-fltk/issues/64 C.go_fltk_MenuButton_popup((*C.Fl_Menu_Button)(m.ptr())) } } diff --git a/text.go b/text.go index 57b71d2..495f574 100644 --- a/text.go +++ b/text.go @@ -557,8 +557,8 @@ func (t *TextEditor) Redo() bool { // // Example: // -// textBuffer := fltk.NewTextBuffer() -// textEditor := fltk.NewTextEditor(x, y, width, height) +// textBuffer := fltk_go.NewTextBuffer() +// textEditor := fltk_go.NewTextEditor(x, y, width, height) // textEditor.SetBuffer(textBuffer) // textBuffer.SetText("Initial Text") // fmt.Println(textBuffer.Text()) // Prints: Initial Text