@@ -105,37 +105,37 @@ const HEIGHT = 400
105
105
106
106
func main () {
107
107
curr := 0
108
- fltk .InitStyles ()
109
- win := fltk .NewWindow (WIDTH, HEIGHT)
108
+ fltk_go .InitStyles ()
109
+ win := fltk_go .NewWindow (WIDTH, HEIGHT)
110
110
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!" )
113
113
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)
115
115
})
116
- bar.SetAlign (fltk .ALIGN_INSIDE | fltk .ALIGN_LEFT )
116
+ bar.SetAlign (fltk_go .ALIGN_INSIDE | fltk_go .ALIGN_LEFT )
117
117
bar.SetLabelColor (255 ) // this uses the index into the color map, here it's white
118
118
bar.SetColor (BLUE)
119
119
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:" )
121
121
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" )
124
124
count.SetLabelSize (36 )
125
125
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
127
127
btn.SetColor (BLUE)
128
128
btn.SetSelectionColor (SEL_BLUE)
129
129
btn.SetLabelColor (255 )
130
- btn.SetBox (fltk .OFLAT_BOX )
130
+ btn.SetBox (fltk_go .OFLAT_BOX )
131
131
btn.ClearVisibleFocus ()
132
132
btn.SetCallback (func () {
133
133
curr += 1
134
134
count.SetLabel (strconv.Itoa (curr))
135
135
})
136
136
win.End ()
137
137
win.Show ()
138
- fltk .Run ()
138
+ fltk_go .Run ()
139
139
}
140
140
```
141
141
@@ -162,17 +162,17 @@ import (
162
162
" github.com/george012/fltk_go"
163
163
164
164
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" )
168
168
if err != nil {
169
169
fmt.Printf (" An error occurred: %s \n " , err)
170
170
} else {
171
171
box.SetImage (image)
172
172
}
173
173
win.End ()
174
174
win.Show ()
175
- fltk .Run ()
175
+ fltk_go .Run ()
176
176
}
177
177
```
178
178
0 commit comments