當前位置: 首頁>>代碼示例>>Golang>>正文


Golang glib.ToGObject函數代碼示例

本文整理匯總了Golang中github.com/conformal/gotk3/glib.ToGObject函數的典型用法代碼示例。如果您正苦於以下問題:Golang ToGObject函數的具體用法?Golang ToGObject怎麽用?Golang ToGObject使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ToGObject函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。

示例1: BackForwardList

// BackForwardList is a wrapper around webkit_web_view_get_back_forward_list().
func (w *WebView) BackForwardList() *BackForwardList {
	c := C.webkit_web_view_get_back_forward_list(w.native())
	obj := &glib.Object{GObject: glib.ToGObject(unsafe.Pointer(c))}
	obj.RefSink()
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return wrapBackForwardList(obj)
}
開發者ID:jrick,項目名稱:go-webkit2,代碼行數:8,代碼來源:webkit2.go

示例2: Flip

// Flip is a wrapper around gdk_pixbuf_flip().
func (v *Pixbuf) Flip(horizontal bool) (*Pixbuf, error) {
	c := C.gdk_pixbuf_flip(v.Native(), gbool(horizontal))
	if c == nil {
		return nil, nilPtrErr
	}
	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	p := &Pixbuf{obj}
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return p, nil
}
開發者ID:jrick,項目名稱:gotk3,代碼行數:11,代碼來源:gdkpixbuf.go

示例3: ScaleSimple

// ScaleSimple is a wrapper around gdk_pixbuf_scale_simple().
func (v *Pixbuf) ScaleSimple(width, height int, interp InterpType) (*Pixbuf, error) {
	c := C.gdk_pixbuf_scale_simple(v.Native(), C.int(width), C.int(height), C.GdkInterpType(interp))
	if c == nil {
		return nil, nilPtrErr
	}
	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	p := &Pixbuf{obj}
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return p, nil
}
開發者ID:jrick,項目名稱:gotk3,代碼行數:11,代碼來源:gdkpixbuf.go

示例4: Context

// Context is a wrapper around webkit_web_view_get_context().
func (w *WebView) Context() *WebContext {
	c := C.webkit_web_view_get_context(w.native())
	if c == nil {
		return nil
	}
	obj := &glib.Object{GObject: glib.ToGObject(unsafe.Pointer(c))}
	obj.RefSink()
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return wrapWebContext(obj)
}
開發者ID:jrick,項目名稱:go-webkit2,代碼行數:11,代碼來源:webkit2.go

示例5: RotateSimple

// RotateSimple is a wrapper around gdk_pixbuf_rotate_simple().
func (v *Pixbuf) RotateSimple(angle PixbufRotation) (*Pixbuf, error) {
	c := C.gdk_pixbuf_rotate_simple(v.Native(), C.GdkPixbufRotation(angle))
	if c == nil {
		return nil, nilPtrErr
	}
	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	p := &Pixbuf{obj}
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return p, nil
}
開發者ID:jrick,項目名稱:gotk3,代碼行數:11,代碼來源:gdkpixbuf.go

示例6: SecurityManager

// SecurityManager is a wrapper around webkit_web_context_get_security_manager().
func (w *WebContext) SecurityManager() *SecurityManager {
	c := C.webkit_web_context_get_security_manager(w.native())
	if c == nil {
		return nil
	}
	obj := &glib.Object{GObject: glib.ToGObject(unsafe.Pointer(c))}
	obj.RefSink()
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return wrapSecurityManager(obj)
}
開發者ID:jrick,項目名稱:go-webkit2,代碼行數:11,代碼來源:webkit2.go

示例7: NewWebViewWithGroup

// NewWebViewWithGroup is a wrapper around webkit_web_view_new_with_group().
func NewWebViewWithGroup(group *WebViewGroup) *WebView {
	c := C.webkit_web_view_new_with_group(group.native())
	if c == nil {
		return nil
	}
	obj := &glib.Object{GObject: glib.ToGObject(unsafe.Pointer(c))}
	obj.RefSink()
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return wrapWebView(obj)
}
開發者ID:jrick,項目名稱:go-webkit2,代碼行數:11,代碼來源:webkit2.go

示例8: FaviconDatabase

// FaviconDatabase is a wrapper around webkit_web_context_get_favicon_database().
func (w *WebContext) FaviconDatabase() *FaviconDatabase {
	c := C.webkit_web_context_get_favicon_database(w.native())
	if c == nil {
		return nil
	}
	obj := &glib.Object{GObject: glib.ToGObject(unsafe.Pointer(c))}
	obj.RefSink()
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return wrapFaviconDatabase(obj)
}
開發者ID:jrick,項目名稱:go-webkit2,代碼行數:11,代碼來源:webkit2.go

示例9: DefaultWebContext

// DefaultWebContext is a wrapper around webkit_web_context_get_default().
func DefaultWebContext() *WebContext {
	c := C.webkit_web_context_get_default()
	if c == nil {
		return nil
	}
	obj := &glib.Object{GObject: glib.ToGObject(unsafe.Pointer(c))}
	obj.RefSink()
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return wrapWebContext(obj)
}
開發者ID:jrick,項目名稱:go-webkit2,代碼行數:11,代碼來源:webkit2.go

示例10: NthItem

// NthItem is a wrapper around webkit_back_forward_list_get_nth_item().
func (l *BackForwardList) NthItem(n int) *BackForwardListItem {
	c := C.webkit_back_forward_list_get_nth_item(l.native(), C.gint(n))
	if c == nil {
		return nil
	}
	obj := &glib.Object{GObject: glib.ToGObject(unsafe.Pointer(c))}
	obj.RefSink()
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return wrapBackForwardListItem(obj)
}
開發者ID:jrick,項目名稱:go-webkit2,代碼行數:11,代碼來源:webkit2.go

示例11: GetHeader

// GetHeader is a wrapper around gtk_list_box_row_get_header().
func (v *ListBoxRow) GetHeader() *Widget {
	c := C.gtk_list_box_row_get_header(v.native())
	if c == nil {
		return nil
	}
	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	w := wrapWidget(obj)
	obj.RefSink()
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return w
}
開發者ID:vvanpo,項目名稱:gotk3,代碼行數:12,代碼來源:gtk_3_10.go

示例12: ListBoxRowNew

func ListBoxRowNew() (*ListBoxRow, error) {
	c := C.gtk_list_box_row_new()
	if c == nil {
		return nil, nilPtrErr
	}
	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	w := wrapListBoxRow(obj)
	obj.RefSink()
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return w, nil
}
開發者ID:vvanpo,項目名稱:gotk3,代碼行數:11,代碼來源:gtk_3_10.go

示例13: GetDeviceManager

// GetDeviceManager() is a wrapper around gdk_display_get_device_manager().
func (v *Display) GetDeviceManager() (*DeviceManager, error) {
	c := C.gdk_display_get_device_manager(v.Native())
	if c == nil {
		return nil, nilPtrErr
	}
	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	d := &DeviceManager{obj}
	obj.Ref()
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return d, nil
}
開發者ID:jrick,項目名稱:gotk3,代碼行數:12,代碼來源:gdk.go

示例14: DisplayGetDefault

// DisplayGetDefault() is a wrapper around gdk_display_get_default().
func DisplayGetDefault() (*Display, error) {
	c := C.gdk_display_get_default()
	if c == nil {
		return nil, nilPtrErr
	}
	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	d := &Display{obj}
	obj.Ref()
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return d, nil
}
開發者ID:jrick,項目名稱:gotk3,代碼行數:12,代碼來源:gdk.go

示例15: GetSystemVisual

// GetSystemVisual is a wrapper around gdk_screen_get_system_visual().
func (v *Screen) GetSystemVisual() (*Visual, error) {
	c := C.gdk_screen_get_system_visual(v.native())
	if c == nil {
		return nil, nilPtrErr
	}
	obj := &glib.Object{glib.ToGObject(unsafe.Pointer(c))}
	visual := &Visual{obj}
	obj.Ref()
	runtime.SetFinalizer(obj, (*glib.Object).Unref)
	return visual, nil
}
開發者ID:alimy,項目名稱:gotk3,代碼行數:12,代碼來源:gdk.go


注:本文中的github.com/conformal/gotk3/glib.ToGObject函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。