-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTextEdit.go
57 lines (43 loc) · 841 Bytes
/
TextEdit.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package walkwrap
import (
"github.com/lxn/walk"
// "github.com/lxn/win"
)
type TextEdit struct {
*walk.TextEdit
}
func NewTextEdit(parent walk.Container, text string, w, h, x, y int) *TextEdit {
t, err := walk.NewTextEdit(parent)
if err != nil {
return nil
}
font, _ := walk.NewFont("微软雅黑", 9, 0)
t.SetFont(font)
t.SetText(text)
t.SetWidth(w)
t.SetHeight(h)
t.SetX(x)
t.SetY(y)
te := new(TextEdit)
te.TextEdit = t
return te
}
type LineEdit struct {
*walk.LineEdit
}
func NewLineEdit(parent walk.Container, text string, w, h, x, y int) *LineEdit {
t, err := walk.NewLineEdit(parent)
if err != nil {
return nil
}
font, _ := walk.NewFont("微软雅黑", 9, 0)
t.SetFont(font)
t.SetText(text)
t.SetWidth(w)
t.SetHeight(h)
t.SetX(x)
t.SetY(y)
te := new(LineEdit)
te.LineEdit = t
return te
}