-
Notifications
You must be signed in to change notification settings - Fork 2
/
helpview.go
86 lines (68 loc) · 2.18 KB
/
helpview.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package fltk_go
/*
#include <stdlib.h>
#include "helpview.h"
*/
import "C"
import "unsafe"
type HelpView struct {
widget
}
func NewHelpView(x, y, w, h int, text ...string) *HelpView {
hv := &HelpView{}
initWidget(hv, unsafe.Pointer(C.go_fltk_new_HelpView(C.int(x), C.int(y), C.int(w), C.int(h), cStringOpt(text))))
return hv
}
func (h *HelpView) Directory() string {
return C.GoString(C.go_fltk_HelpView_directory((*C.Fl_Help_View)(h.ptr())))
}
func (h *HelpView) Filename() string {
return C.GoString(C.go_fltk_HelpView_filename((*C.Fl_Help_View)(h.ptr())))
}
func (h *HelpView) Find(str string, i ...int) int {
if len(i) < 1 {
i = append(i, 0)
}
cStr := C.CString(str)
defer C.free(unsafe.Pointer(cStr))
return int(C.go_fltk_HelpView_find((*C.Fl_Help_View)(h.ptr()), cStr, C.int(i[0])))
}
func (h *HelpView) Load(f string) {
fStr := C.CString(f)
defer C.free(unsafe.Pointer(fStr))
C.go_fltk_HelpView_load((*C.Fl_Help_View)(h.ptr()), fStr)
}
func (h *HelpView) LeftLine() int {
return int(C.go_fltk_HelpView_leftline((*C.Fl_Help_View)(h.ptr())))
}
func (h *HelpView) SetLeftLine(i int) {
C.go_fltk_HelpView_set_leftline((*C.Fl_Help_View)(h.ptr()), C.int(i))
}
func (h *HelpView) TopLine() int {
return int(C.go_fltk_HelpView_topline((*C.Fl_Help_View)(h.ptr())))
}
func (h *HelpView) SetTopLine(i int) {
C.go_fltk_HelpView_set_topline((*C.Fl_Help_View)(h.ptr()), C.int(i))
}
func (h *HelpView) SetTopLineString(str string) {
cStr := C.CString(str)
defer C.free(unsafe.Pointer(cStr))
C.go_fltk_HelpView_set_toplinestring((*C.Fl_Help_View)(h.ptr()), cStr)
}
func (h *HelpView) Value() string {
return C.GoString(C.go_fltk_HelpView_value((*C.Fl_Help_View)(h.ptr())))
}
func (h *HelpView) SetValue(str string) {
cStr := C.CString(str)
defer C.free(unsafe.Pointer(cStr))
C.go_fltk_HelpView_set_value((*C.Fl_Help_View)(h.ptr()), cStr)
}
func (h *HelpView) TextSize(size int) {
C.go_fltk_HelpView_set_textsize((*C.Fl_Help_View)(h.ptr()), C.int(size))
}
func (h *HelpView) TextFont(font Font) {
C.go_fltk_HelpView_set_textfont((*C.Fl_Help_View)(h.ptr()), C.int(font))
}
func (h *HelpView) TextColor(col Color) {
C.go_fltk_HelpView_set_textcolor((*C.Fl_Help_View)(h.ptr()), C.uint(col))
}