示例#1
0
// GetWindow is a wrapper around gtk_widget_get_window().
func (v *Widget) GetWindow() (*gdk.Window, error) {
	c := C.gtk_widget_get_window(v.native())
	if c == nil {
		return nil, nilPtrErr
	}

	w := &gdk.Window{wrapObject(unsafe.Pointer(c))}
	return w, nil
}
示例#2
0
文件: widget.go 项目: ziutek/gtk
func (w *Widget) GetWindow() *gdk.Window {
	gw := new(gdk.Window)
	gw.SetPtr(glib.Pointer(C.gtk_widget_get_window(w.g())))
	//gw.SetPtr(glib.Pointer(w.g().window))
	return gw
}
示例#3
0
文件: gtk.go 项目: evmar/smash
func (w *Window) GetContentPosition() (int, int) {
	gdkWin := C.gtk_widget_get_window(w.gtkWin)
	var cx, cy C.gint
	C.gdk_window_get_position(gdkWin, &cx, &cy)
	return int(cx), int(cy)
}
示例#4
0
文件: gtk.go 项目: evmar/smash
func (w *Window) GetCairo() *cairo.Context {
	return cairo.WrapContext(unsafe.Pointer(C.gdk_cairo_create(C.gtk_widget_get_window(w.gtkWin))))
}