示例#1
0
func (e *Element) PrependHtml(prefix string) {
	szHtml := C.CString(prefix)
	defer C.free(unsafe.Pointer(szHtml))
	if ret := C.HTMLayoutSetElementHtml(e.handle, (*C.BYTE)(unsafe.Pointer(szHtml)), C.DWORD(len(prefix)), SIH_INSERT_AT_START); ret != HLDOM_OK {
		domPanic(ret, "Failed to prepend to element's html")
	}
}
示例#2
0
func (e *Element) AppendHtml(suffix string) {
	szHtml := C.CString(suffix)
	defer C.free(unsafe.Pointer(szHtml))
	if ret := C.HTMLayoutSetElementHtml(e.handle, (*C.BYTE)(unsafe.Pointer(szHtml)), C.DWORD(len(suffix)), SIH_APPEND_AFTER_LAST); ret != HLDOM_OK {
		domPanic(ret, "Failed to append to element's html")
	}
}
示例#3
0
func (e *Element) SetHtml(html string) {
	szHtml := C.CString(html)
	defer C.free(unsafe.Pointer(szHtml))
	if ret := C.HTMLayoutSetElementHtml(e.handle, (*C.BYTE)(unsafe.Pointer(szHtml)), C.DWORD(len(html)), SIH_REPLACE_CONTENT); ret != HLDOM_OK {
		domPanic(ret, "Failed to replace element's html")
	}
}