示例#1
0
文件: box.go 项目: napsy/go-gtk3
func (self *Box) QueryChildPacking(w WidgetLike) (expand bool, fill bool, padding uint, ptype GtkPackType) {
	var e C.gboolean
	var f C.gboolean
	var p C.guint
	var t C.GtkPackType
	C.gtk_box_query_child_packing(self.object, w.W().object, &e, &f, &p, &t)

	return gobject.GoBool(unsafe.Pointer(&e)), gobject.GoBool(unsafe.Pointer(&f)), uint(p), GtkPackType(t)
}
示例#2
0
文件: gdk3.go 项目: jkeys089/go-gtk3
// Conversion function
func newEventFromNative(obj unsafe.Pointer) interface{} {
	// Cast to EventAny to extract type and send var
	var window *Window = nil
	ceventAny := (*C.GdkEventAny)(obj)
	t := int(ceventAny._type)
	if win, err := gobject.ConvertToGo(unsafe.Pointer(ceventAny.window)); err == nil {
		window = win.(*Window)
	}
	se := ceventAny.send_event
	send := gobject.GoBool(unsafe.Pointer(&se))

	// Create new EventAny Struct
	eventAny := EventAny{t, window, send}

	// test specific events
	switch t {
	case GdkEventType.KEY_PRESS, GdkEventType.KEY_RELEASE:
		ek := createEventKey(obj)
		ek.EventAny = eventAny
		return ek
	case GdkEventType.BUTTON_PRESS, GdkEventType.BUTTON_PRESS_2, GdkEventType.BUTTON_PRESS_3,
		GdkEventType.BUTTON_RELEASE:
		eb := createEventButton(obj)
		eb.EventAny = eventAny
		return eb
	}
	return eventAny
}
示例#3
0
文件: label.go 项目: napsy/go-gtk3
func (self *Label) GetSelectionBounds() (bool, int, int) {
	var start C.gint
	var end C.gint
	b := C.gtk_label_get_selection_bounds(self.object, &start, &end)
	isSel := gobject.GoBool(unsafe.Pointer(&b))

	return isSel, int(start), int(end)
}
示例#4
0
func (self *FontDescription) BetterMatch(oldMatch, newMatch *FontDescription) bool {
	var fDesc *C.PangoFontDescription = nil

	if oldMatch != nil {
		fDesc = oldMatch.object
	}

	b := C.pango_font_description_better_match(self.object, fDesc, newMatch.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
示例#5
0
文件: gdk3.go 项目: jkeys089/go-gtk3
func (self Rectangle) Intersect(r2 Rectangle) (bool, Rectangle) {
	var cr3 C.GdkRectangle
	cr1 := nativeFromRectangle(self)
	defer cr1.Free()
	cr2 := nativeFromRectangle(r2)
	defer cr2.Free()
	b := C.gdk_rectangle_intersect((*C.GdkRectangle)(cr1.GetPtr()), (*C.GdkRectangle)(cr2.GetPtr()), &cr3)
	rec := newRectangleFromNative(unsafe.Pointer(&cr3)).(Rectangle)

	return gobject.GoBool(unsafe.Pointer(&b)), rec
}
示例#6
0
// Conversion function
func newEventFromNative(obj unsafe.Pointer) interface{} {
	// Cast to EventAny to extract type and send var
	ceventAny := (*C.GdkEventAny)(obj)
	t := GdkEventType(ceventAny._type)
	se := ceventAny.send_event
	send := gobject.GoBool(unsafe.Pointer(&se))

	// Create new EventAny Struct
	eventAny := EventAny{t, send}

	// test specific events
	switch t {
	case EventType.KEY_PRESS, EventType.KEY_RELEASE:
		ek := createEventKey(obj)
		ek.EventAny = eventAny
		return ek
	case EventType.BUTTON_PRESS, EventType.BUTTON_PRESS_2, EventType.BUTTON_PRESS_3,
		EventType.BUTTON_RELEASE:
		eb := createEventButton(obj)
		eb.EventAny = eventAny
		return eb
	}
	return eventAny
}
示例#7
0
文件: label.go 项目: napsy/go-gtk3
func (self *Label) GetUseUnderline() bool {
	b := C.gtk_label_get_use_underline(self.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
示例#8
0
文件: label.go 项目: napsy/go-gtk3
func (self *Label) GetUseMarkup() bool {
	b := C.gtk_label_get_use_markup(self.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
示例#9
0
文件: window.go 项目: napsy/go-gtk3
func (self *Window) GetSkipPagerHint() bool {
	b := gobject.GetProperty(self, "skip-pager-hint")
	defer b.Free()
	return gobject.GoBool(b.GetPtr())
}
示例#10
0
文件: window.go 项目: napsy/go-gtk3
func (self *Window) GetFocusOnMap() bool {
	b := gobject.GetProperty(self, "focus-on-map")
	defer b.Free()
	return gobject.GoBool(b.GetPtr())
}
示例#11
0
文件: button.go 项目: napsy/go-gtk3
func (self *Button) GetUseUnderline() bool {
	b := C.gtk_button_get_use_underline(self.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
示例#12
0
文件: widget.go 项目: napsy/go-gtk3
func (self *Widget) IsFocus() bool {
	b := C.gtk_widget_is_focus(self.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
示例#13
0
文件: widget.go 项目: napsy/go-gtk3
func (self *Widget) InDestruction() bool {
	b := C.gtk_widget_in_destruction(self.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
示例#14
0
文件: window.go 项目: napsy/go-gtk3
func (self *Window) GetUrgencyHint() bool {
	b := gobject.GetProperty(self, "urgency-hint")
	defer b.Free()
	return gobject.GoBool(b.GetPtr())
}
示例#15
0
文件: window.go 项目: napsy/go-gtk3
func (self *Window) GetModal() bool {
	b := gobject.GetProperty(self, "modal")
	defer b.Free()
	return gobject.GoBool(b.GetPtr())
}
示例#16
0
文件: window.go 项目: napsy/go-gtk3
func (self *Window) GetDeletable() bool {
	b := gobject.GetProperty(self, "deletable")
	defer b.Free()
	return gobject.GoBool(b.GetPtr())
}
示例#17
0
文件: window.go 项目: napsy/go-gtk3
func (self *Window) GetDecorated() bool {
	b := gobject.GetProperty(self, "decorated")
	defer b.Free()
	return gobject.GoBool(b.GetPtr())
}
示例#18
0
文件: window.go 项目: napsy/go-gtk3
func (self *Window) GetMnemonicsVisible() bool {
	b := gobject.GetProperty(self, "mnemonics-visible")
	defer b.Free()
	return gobject.GoBool(b.GetPtr())
}
示例#19
0
文件: window.go 项目: napsy/go-gtk3
func (self *Window) GetDestroyWithParent() bool {
	b := gobject.GetProperty(self, "destroy-with-parent")
	defer b.Free()
	return gobject.GoBool(b.GetPtr())
}
示例#20
0
文件: label.go 项目: napsy/go-gtk3
func (self *Label) GetSingleLineMode() bool {
	b := C.gtk_label_get_single_line_mode(self.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
示例#21
0
文件: label.go 项目: napsy/go-gtk3
func (self *Label) GetTrackVisitedLinks() bool {
	b := C.gtk_label_get_track_visited_links(self.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
示例#22
0
func (self *FontDescription) GetSizeIsAbsolute() bool {
	b := C.pango_font_description_get_size_is_absolute(self.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
示例#23
0
文件: widget.go 项目: napsy/go-gtk3
func (self *Widget) Activate() bool {
	b := C.gtk_widget_activate(self.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
示例#24
0
文件: box.go 项目: napsy/go-gtk3
func (self *Box) GetHomogeneous() bool {
	h := gobject.GetProperty(self, "homogeneous")
	defer h.Free()
	return gobject.GoBool(h.GetPtr())
}
示例#25
0
文件: button.go 项目: napsy/go-gtk3
func (self *Button) GetUseStock() bool {
	b := C.gtk_button_get_use_stock(self.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
示例#26
0
文件: label.go 项目: napsy/go-gtk3
func (self *Label) GetLineWrap() bool {
	lw := C.gtk_label_get_line_wrap(self.object)
	return gobject.GoBool(unsafe.Pointer(&lw))
}
示例#27
0
文件: button.go 项目: napsy/go-gtk3
func (self *Button) GetFocusOnClick() bool {
	b := C.gtk_button_get_focus_on_click(self.object)
	return gobject.GoBool(unsafe.Pointer(&b))
}
示例#28
0
文件: window.go 项目: napsy/go-gtk3
func (self *Window) GetAcceptFocus() bool {
	b := gobject.GetProperty(self, "accept-focus")
	defer b.Free()
	return gobject.GoBool(b.GetPtr())
}
示例#29
0
文件: label.go 项目: napsy/go-gtk3
func (self *Label) GetSelectable() bool {
	sel := C.gtk_label_get_selectable(self.object)
	return gobject.GoBool(unsafe.Pointer(&sel))
}
示例#30
0
文件: glib.go 项目: jkeys089/go-gtk3
func GSourceRemove(tag uint) bool {
	b := C.g_source_remove(C.guint(tag))
	return gobject.GoBool(unsafe.Pointer(&b))
}