コード例 #1
0
ファイル: control_unix.go プロジェクト: NotBadPad/ui
func dobasecommitResize(w *C.GtkWidget, c *allocation, d *sizing) {
	// as we resize on size-allocate, we have to also use size-allocate on our children
	// this is fine anyway; in fact, this allows us to move without knowing what the container is!
	// this is what GtkBox does anyway
	// thanks to tristan in irc.gimp.net/#gtk+

	var r C.GtkAllocation

	r.x = C.int(c.x)
	r.y = C.int(c.y)
	r.width = C.int(c.width)
	r.height = C.int(c.height)
	C.gtk_widget_size_allocate(w, &r)
}
コード例 #2
0
ファイル: control_unix.go プロジェクト: sjn1978/ui
func (c *controlSingleWidget) xresize(x int, y int, width int, height int, d *sizing) {
	// as we resize on size-allocate, we have to also use size-allocate on our children
	// this is fine anyway; in fact, this allows us to move without knowing what the container is!
	// this is what GtkBox does anyway
	// thanks to tristan in irc.gimp.net/#gtk+

	var r C.GtkAllocation

	r.x = C.int(x)
	r.y = C.int(y)
	r.width = C.int(width)
	r.height = C.int(height)
	C.gtk_widget_size_allocate(c.widget, &r)
}