Skip to content

Commit 90a1f5d

Browse files
committed
Update v0.0.16
1 parent ca771b6 commit 90a1f5d

File tree

53 files changed

+89
-137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+89
-137
lines changed

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,37 +105,37 @@ const HEIGHT = 400
105105

106106
func main() {
107107
curr := 0
108-
fltk.InitStyles()
109-
win := fltk.NewWindow(WIDTH, HEIGHT)
108+
fltk_go.InitStyles()
109+
win := fltk_go.NewWindow(WIDTH, HEIGHT)
110110
win.SetLabel("Flutter-like")
111-
win.SetColor(fltk.WHITE)
112-
bar := fltk.NewBox(fltk.FLAT_BOX, 0, 0, WIDTH, 60, " FLTK App!")
111+
win.SetColor(fltk_go.WHITE)
112+
bar := fltk_go.NewBox(fltk_go.FLAT_BOX, 0, 0, WIDTH, 60, " FLTK App!")
113113
bar.SetDrawHandler(func() { // Shadow under the bar
114-
fltk.DrawBox(fltk.FLAT_BOX, 0, 0, WIDTH, 63, LIGHT_GRAY)
114+
fltk_go.DrawBox(fltk_go.FLAT_BOX, 0, 0, WIDTH, 63, LIGHT_GRAY)
115115
})
116-
bar.SetAlign(fltk.ALIGN_INSIDE | fltk.ALIGN_LEFT)
116+
bar.SetAlign(fltk_go.ALIGN_INSIDE | fltk_go.ALIGN_LEFT)
117117
bar.SetLabelColor(255) // this uses the index into the color map, here it's white
118118
bar.SetColor(BLUE)
119119
bar.SetLabelSize(22)
120-
text := fltk.NewBox(fltk.NO_BOX, 250, 180, 100, 40, "You have pushed the button this many times:")
120+
text := fltk_go.NewBox(fltk_go.NO_BOX, 250, 180, 100, 40, "You have pushed the button this many times:")
121121
text.SetLabelSize(18)
122-
text.SetLabelFont(fltk.TIMES)
123-
count := fltk.NewBox(fltk.NO_BOX, 250, 180+40, 100, 40, "0")
122+
text.SetLabelFont(fltk_go.TIMES)
123+
count := fltk_go.NewBox(fltk_go.NO_BOX, 250, 180+40, 100, 40, "0")
124124
count.SetLabelSize(36)
125125
count.SetLabelColor(GRAY)
126-
btn := fltk.NewButton(WIDTH-100, HEIGHT-100, 60, 60, "@+6plus") // This translates to a plus sign
126+
btn := fltk_go.NewButton(WIDTH-100, HEIGHT-100, 60, 60, "@+6plus") // This translates to a plus sign
127127
btn.SetColor(BLUE)
128128
btn.SetSelectionColor(SEL_BLUE)
129129
btn.SetLabelColor(255)
130-
btn.SetBox(fltk.OFLAT_BOX)
130+
btn.SetBox(fltk_go.OFLAT_BOX)
131131
btn.ClearVisibleFocus()
132132
btn.SetCallback(func() {
133133
curr += 1
134134
count.SetLabel(strconv.Itoa(curr))
135135
})
136136
win.End()
137137
win.Show()
138-
fltk.Run()
138+
fltk_go.Run()
139139
}
140140
```
141141

@@ -162,17 +162,17 @@ import (
162162
"github.com/george012/fltk_go"
163163

164164
func main() {
165-
win := fltk.NewWindow(400, 300)
166-
box := fltk.NewBox(fltk.FLAT_BOX, 0, 0, 400, 300, "")
167-
image, err := fltk.NewJpegImageLoad("image.jpg")
165+
win := fltk_go.NewWindow(400, 300)
166+
box := fltk_go.NewBox(fltk_go.FLAT_BOX, 0, 0, 400, 300, "")
167+
image, err := fltk_go.NewJpegImageLoad("image.jpg")
168168
if err != nil {
169169
fmt.Printf("An error occurred: %s\n", err)
170170
} else {
171171
box.SetImage(image)
172172
}
173173
win.End()
174174
win.Show()
175-
fltk.Run()
175+
fltk_go.Run()
176176
}
177177
```
178178

README_zh-cn.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -105,37 +105,37 @@ const HEIGHT = 400
105105

106106
func main() {
107107
curr := 0
108-
fltk.InitStyles()
109-
win := fltk.NewWindow(WIDTH, HEIGHT)
108+
fltk_go.InitStyles()
109+
win := fltk_go.NewWindow(WIDTH, HEIGHT)
110110
win.SetLabel("Flutter-like")
111-
win.SetColor(fltk.WHITE)
112-
bar := fltk.NewBox(fltk.FLAT_BOX, 0, 0, WIDTH, 60, " FLTK App!")
111+
win.SetColor(fltk_go.WHITE)
112+
bar := fltk_go.NewBox(fltk_go.FLAT_BOX, 0, 0, WIDTH, 60, " FLTK App!")
113113
bar.SetDrawHandler(func() { // Shadow under the bar
114-
fltk.DrawBox(fltk.FLAT_BOX, 0, 0, WIDTH, 63, LIGHT_GRAY)
114+
fltk_go.DrawBox(fltk_go.FLAT_BOX, 0, 0, WIDTH, 63, LIGHT_GRAY)
115115
})
116-
bar.SetAlign(fltk.ALIGN_INSIDE | fltk.ALIGN_LEFT)
116+
bar.SetAlign(fltk_go.ALIGN_INSIDE | fltk_go.ALIGN_LEFT)
117117
bar.SetLabelColor(255) // this uses the index into the color map, here it's white
118118
bar.SetColor(BLUE)
119119
bar.SetLabelSize(22)
120-
text := fltk.NewBox(fltk.NO_BOX, 250, 180, 100, 40, "You have pushed the button this many times:")
120+
text := fltk_go.NewBox(fltk_go.NO_BOX, 250, 180, 100, 40, "You have pushed the button this many times:")
121121
text.SetLabelSize(18)
122-
text.SetLabelFont(fltk.TIMES)
123-
count := fltk.NewBox(fltk.NO_BOX, 250, 180+40, 100, 40, "0")
122+
text.SetLabelFont(fltk_go.TIMES)
123+
count := fltk_go.NewBox(fltk_go.NO_BOX, 250, 180+40, 100, 40, "0")
124124
count.SetLabelSize(36)
125125
count.SetLabelColor(GRAY)
126-
btn := fltk.NewButton(WIDTH-100, HEIGHT-100, 60, 60, "@+6plus") // 这翻译成一个加号
126+
btn := fltk_go.NewButton(WIDTH-100, HEIGHT-100, 60, 60, "@+6plus") // 这翻译成一个加号
127127
btn.SetColor(BLUE)
128128
btn.SetSelectionColor(SEL_BLUE)
129129
btn.SetLabelColor(255)
130-
btn.SetBox(fltk.OFLAT_BOX)
130+
btn.SetBox(fltk_go.OFLAT_BOX)
131131
btn.ClearVisibleFocus()
132132
btn.SetCallback(func() {
133133
curr += 1
134134
count.SetLabel(strconv.Itoa(curr))
135135
})
136136
win.End()
137137
win.Show()
138-
fltk.Run()
138+
fltk_go.Run()
139139
}
140140
```
141141

@@ -163,17 +163,17 @@ import (
163163
)
164164

165165
func main() {
166-
win := fltk.NewWindow(400, 300)
167-
box := fltk.NewBox(fltk.FLAT_BOX, 0, 0, 400, 300, "")
168-
image, err := fltk.NewJpegImageLoad("image.jpg")
166+
win := fltk_go.NewWindow(400, 300)
167+
box := fltk_go.NewBox(fltk_go.FLAT_BOX, 0, 0, 400, 300, "")
168+
image, err := fltk_go.NewJpegImageLoad("image.jpg")
169169
if err != nil {
170170
fmt.Printf("An error occured: %s\n", err)
171171
} else {
172172
box.SetImage(image)
173173
}
174174
win.End()
175175
win.Show()
176-
fltk.Run()
176+
fltk_go.Run()
177177
}
178178
```
179179

cgo_darwin_arm64.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
//go:build darwin && arm64
2-
// +build darwin,arm64
32

43
package fltk_go
54

65
// #cgo darwin,arm64 CXXFLAGS: -std=c++11
7-
// #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
6+
// #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
87
// #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
98
import "C"

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ package config
22

33
const (
44
ProjectName = "fltk_go"
5-
ProjectVersion = "v0.0.15"
5+
ProjectVersion = "v0.0.16"
66
)

examples/7GUIs/cells/main.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package main
22

3-
import (
4-
"github.com/george012/fltk_go"
5-
)
3+
import "github.com/george012/fltk_go"
64

75
const (
86
WIDGET_HEIGHT = 200

examples/7GUIs/cells/panel.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package main
22

33
import (
4-
"log"
5-
64
"github.com/george012/fltk_go"
5+
"log"
76
)
87

98
type Panel struct {
@@ -76,7 +75,7 @@ func (p *Panel) Bind(ctx *Context) {
7675
}
7776
})
7877

79-
// p.tb.SetCallbackCondition(fltk_go.WhenNotChanged)
78+
// p.tb.SetCallbackCondition(fltk.WhenNotChanged)
8079
p.tb.SetCallback(func() {
8180
tc := p.tb.CallbackContext()
8281
if tc != fltk_go.ContextCell {

examples/7GUIs/circle/main.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package main
22

3-
import (
4-
"github.com/george012/fltk_go"
5-
)
3+
import "github.com/george012/fltk_go"
64

75
const (
86
WIDGET_HEIGHT = 25

examples/7GUIs/circle/panel.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ package main
22

33
import (
44
"fmt"
5-
"runtime"
6-
75
"github.com/george012/fltk_go"
6+
"runtime"
87
)
98

109
type Panel struct {

examples/7GUIs/counter/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
package main
22

33
import (
4-
"strconv"
5-
64
"github.com/george012/fltk_go"
5+
"strconv"
76
)
87

98
const (

examples/7GUIs/crud/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ package main
22

33
import (
44
"fmt"
5+
"github.com/george012/fltk_go"
56
"log"
67
"strings"
7-
8-
"github.com/george012/fltk_go"
98
)
109

1110
const (

0 commit comments

Comments
 (0)