Пример #1
0
func WebBrowser(opts ...interface{}) *Ihandle {
	if webBrowserLibOpened == false {
		C.IupWebBrowserOpen()
		webBrowserLibOpened = true
	}

	ih := (*Ihandle)(C.IupWebBrowser())

	for _, o := range opts {
		switch v := o.(type) {
		case CompletedFunc:
			SetCompletedFunc(ih, v)

		case ErrorFunc:
			SetErrorFunc(ih, v)

		case NavigateFunc:
			SetNavigateFunc(ih, v)

		case NewWindowFunc:
			SetNewWindowFunc(ih, v)

		default:
			Decorate(ih, o)
		}
	}

	return ih
}
Пример #2
0
func Open() *iup.Error {
	r := C.IupWebBrowserOpen()
	if r == C.IUP_ERROR {
		return &iup.Error{"IupWebBrowserOpen"}
	}
	return nil
}