本文整理汇总了Golang中C.GdkRectangle类的典型用法代码示例。如果您正苦于以下问题:Golang GdkRectangle类的具体用法?Golang GdkRectangle怎么用?Golang GdkRectangle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了GdkRectangle类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: ToNative
func (self Rectangle) ToNative() unsafe.Pointer {
var cr C.GdkRectangle
cr.x = C.int(self.X)
cr.y = C.int(self.Y)
cr.width = C.int(self.Width)
cr.height = C.int(self.Height)
return unsafe.Pointer(&cr)
}
示例2: our_area_get_child_position_callback
//export our_area_get_child_position_callback
func our_area_get_child_position_callback(overlay *C.GtkOverlay, widget *C.GtkWidget, rect *C.GdkRectangle, data C.gpointer) C.gboolean {
var nat C.GtkRequisition
a := (*area)(unsafe.Pointer(data))
rect.x = C.int(a.textfieldx)
rect.y = C.int(a.textfieldy)
C.gtk_widget_get_preferred_size(a.textfieldw, nil, &nat)
rect.width = C.int(nat.width)
rect.height = C.int(nat.height)
return C.TRUE
}
示例3: Invalidate
func (v *GdkWindow) Invalidate(rect *Rectangle, invalidate_children bool) {
if rect != nil {
var _rect C.GdkRectangle
_rect.x = C.gint(rect.X)
_rect.y = C.gint(rect.Y)
_rect.width = C.gint(rect.Width)
_rect.height = C.gint(rect.Height)
C.gdk_window_invalidate_rect(v.Window, &_rect, bool2gboolean(invalidate_children))
} else {
C.gdk_window_invalidate_rect(v.Window, nil, bool2gboolean(invalidate_children))
}
}