File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
- "log"
5
4
"os"
6
5
"strings"
7
6
@@ -18,10 +17,9 @@ var inputChoices []string
18
17
var outputChoices []string
19
18
20
19
func main () {
21
- log .SetFlags (log .LstdFlags | log .Lshortfile )
22
20
argsWithoutProg := os .Args [1 :]
23
21
if len (argsWithoutProg ) != 3 {
24
- log . Println ("Usage: multichoice Title Prompt Choices;here" )
22
+ println ("Usage: multichoice Title Prompt Choices;here" )
25
23
os .Exit (1 )
26
24
}
27
25
title := argsWithoutProg [0 ]
@@ -66,21 +64,19 @@ func main() {
66
64
},
67
65
},
68
66
}.Create ()); err != nil {
69
- log . Fatal (err )
67
+ panic (err )
70
68
}
71
69
72
70
mw .Run ()
73
71
}
74
72
75
73
func CheckBoxList (choices []string ) []Widget {
76
- bs := make ([]* walk.CheckBox , len (choices ))
77
74
children := []Widget {}
78
- for i , name := range choices {
79
- bs [i ] = new (walk.CheckBox )
75
+ for _ , name := range choices {
80
76
indexName := name
81
77
children = append (children , CheckBox {
82
- AssignTo : & bs [ i ],
83
- Text : name ,
78
+ Alignment : AlignHNearVNear , // added
79
+ Text : name ,
84
80
OnClicked : func () {
85
81
if i := contains (indexName , outputChoices ); i != - 1 {
86
82
outputChoices = remove (outputChoices , i )
You can’t perform that action at this time.
0 commit comments