Example #1
0
File: box.go Project: napsy/go-gtk3
// Box interface
func (self *Box) PackStart(w WidgetLike, expand bool, fill bool, padding uint) {
	e := gobject.GBool(expand)
	f := gobject.GBool(fill)
	defer e.Free()
	defer f.Free()
	C.gtk_box_pack_start(self.object, w.W().object, *((*C.gboolean)(e.GetPtr())), *((*C.gboolean)(e.GetPtr())), C.guint(padding))
}
Example #2
0
File: box.go Project: napsy/go-gtk3
func (self *Box) SetChildPacking(w WidgetLike, expand bool, fill bool, padding int, ptype GtkPackType) {
	e := gobject.GBool(expand)
	f := gobject.GBool(fill)
	defer e.Free()
	defer f.Free()
	C.gtk_box_set_child_packing(self.object, w.W().object, *((*C.gboolean)(e.GetPtr())), *((*C.gboolean)(f.GetPtr())),
		C.guint(padding), C.GtkPackType(ptype))
}
Example #3
0
func (self *FontDescription) Merget(descToMerge *FontDescription, replaceExisting bool) {
	b := gobject.GBool(replaceExisting)
	defer b.Free()

	if descToMerge == nil {
		C.pango_font_description_merge(self.object, nil, *((*C.gboolean)(b.GetPtr())))
		return
	}
	C.pango_font_description_merge(self.object, descToMerge.object, *((*C.gboolean)(b.GetPtr())))
}
Example #4
0
// Exported functions
//export _g_source_func
func _g_source_func(user_data unsafe.Pointer) C.gboolean {
	id := *((*C.gint64)(user_data))
	var res bool

	if f, ok := _closures[int64(id)]; ok {
		res = f([]interface{}{})
	}
	b := gobject.GBool(res)
	defer b.Free()
	return *((*C.gboolean)(b.GetPtr()))
}
Example #5
0
func AtomIntern(atomName string, onlyIfExists bool) Atom {
	s := gobject.GString(atomName)
	defer s.Free()
	b := gobject.GBool(onlyIfExists)
	defer b.Free()

	o := C.gdk_atom_intern((*C.gchar)(s.GetPtr()), *((*C.gboolean)(b.GetPtr())))

	a := Atom{}
	a.object = new(C.GdkAtom)
	*a.object = o

	return a
}
Example #6
0
func (self *Label) SetTrackVisitedLinks(setting bool) {
	b := gobject.GBool(setting)
	defer b.Free()
	C.gtk_label_set_track_visited_links(self.object, *((*C.gboolean)(b.GetPtr())))
}
Example #7
0
func (self *Label) SetSingleLineMode(setting bool) {
	b := gobject.GBool(setting)
	defer b.Free()
	C.gtk_label_set_single_line_mode(self.object, *((*C.gboolean)(b.GetPtr())))
}
Example #8
0
func (self *Label) SetUseUnderline(setting bool) {
	b := gobject.GBool(setting)
	defer b.Free()
	C.gtk_label_set_use_underline(self.object, *((*C.gboolean)(b.GetPtr())))
}
Example #9
0
func (self *Label) SetSelectable(setting bool) {
	b := gobject.GBool(setting)
	defer b.Free()
	C.gtk_label_set_selectable(self.object, *((*C.gboolean)(b.GetPtr())))
}
Example #10
0
func (self *Label) SetLineWrap(wrap bool) {
	b := gobject.GBool(wrap)
	defer b.Free()
	C.gtk_label_set_line_wrap(self.object, *((*C.gboolean)(b.GetPtr())))
}