-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathimagelist.go
44 lines (33 loc) · 956 Bytes
/
imagelist.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
package gform
import (
"github.com/AllenDang/w32"
)
type ImageList struct {
handle w32.HIMAGELIST
}
func NewImageList(cx, cy int, flags uint, cInitial, cGrow int) *ImageList {
imgl := new(ImageList)
imgl.handle = w32.ImageList_Create(cx, cy, flags, cInitial, cGrow)
return imgl
}
func (this *ImageList) Handle() w32.HIMAGELIST {
return this.handle
}
func (this *ImageList) Destroy() bool {
return w32.ImageList_Destroy(this.handle)
}
func (this *ImageList) SetImageCount(uNewCount uint) bool {
return w32.ImageList_SetImageCount(this.handle, uNewCount)
}
func (this *ImageList) ImageCount() int {
return w32.ImageList_GetImageCount(this.handle)
}
func (this *ImageList) AddIcon(icon *Icon) int {
return w32.ImageList_AddIcon(this.handle, icon.Handle())
}
func (this *ImageList) RemoveAll() bool {
return w32.ImageList_RemoveAll(this.handle)
}
func (this *ImageList) Remove(i int) bool {
return w32.ImageList_Remove(this.handle, i)
}