コード例 #1
0
ファイル: psi.go プロジェクト: d3x0r/SACK
func (parent *Control) AddControl(control_type string, x int, y int, w uint, h uint) {
	var c *Control = &Control{}

	c_type := C.CString(control_type)

	fmt.Println("c.control is", c.control)

	fmt.Println("Creating legacy control...", c.control)
	c.control = C.MakeNamedControl(parent.control, c_type, C.int(x), C.int(y), C.int(w), C.int(h), 0)
	fmt.Println("Created legacy control...", c.control)
}
コード例 #2
0
ファイル: psi.go プロジェクト: d3x0r/SACK
func (parent *Control) Add(c *Control, x int, y int, w uint, h uint) {
	if c.methods == nil {
		fmt.Println("control has not been defined")
		return
	}
	fmt.Println("c.control is", c.control)
	if c.control == nil {
		create_mutex.Lock()
		creating = c
		fmt.Println("Creating custom control...", c.control)
		c.control = C.MakeNamedControl(parent.control, control_name, C.int(x), C.int(y), C.int(w), C.int(h), 0)
		fmt.Println("Created custom control...", c.control)
		create_mutex.Unlock()
		fmt.Println("result of add is ", c.control)
	} else {
		fmt.Println("wasn't nil?", c.control, " or ", unsafe.Pointer(uintptr(0)))
	}
}