Example #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
}
Example #2
0
File: widget.go Project: 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
}
Example #3
0
File: gtk.go Project: 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)
}
Example #4
0
File: gtk.go Project: evmar/smash
func (w *Window) GetCairo() *cairo.Context {
	return cairo.WrapContext(unsafe.Pointer(C.gdk_cairo_create(C.gtk_widget_get_window(w.gtkWin))))
}