Exemplo n.º 1
0
Arquivo: box.go Projeto: napsy/go-gtk3
func NewBox(orientation GtkOrientation, spacing int) *Box {
	box := &Box{}

	o := C.gtk_box_new(C.GtkOrientation(orientation), C.gint(spacing))

	box.Container = NewContainer(unsafe.Pointer(o))
	box.object = C.to_GtkBox(unsafe.Pointer(o))

	return box
}
Exemplo n.º 2
0
// AddPalette() is a wrapper around gtk_color_chooser_add_palette().
func (v *ColorChooser) AddPalette(orientation Orientation, colors_per_line int, colors []*gdk.RGBA) {
	n_colors := len(colors)
	var c_colors []C.GdkRGBA
	for _, c := range colors {
		c_colors = append(c_colors, *(*C.GdkRGBA)(unsafe.Pointer(c.Native())))
	}
	C.gtk_color_chooser_add_palette(
		v.native(),
		C.GtkOrientation(orientation),
		C.gint(colors_per_line),
		C.gint(n_colors),
		&c_colors[0],
	)
}
Exemplo n.º 3
0
	// NotebookTab
	NOTEBOOK_TAB_FIRST = C.GtkNotebookTab(C.GTK_NOTEBOOK_TAB_FIRST)
	NOTEBOOK_TAB_LAST  = C.GtkNotebookTab(C.GTK_NOTEBOOK_TAB_LAST)

	// NumberUpLayout
	NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM = C.GtkNumberUpLayout(C.GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM)
	NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP = C.GtkNumberUpLayout(C.GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP)
	NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM = C.GtkNumberUpLayout(C.GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM)
	NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP = C.GtkNumberUpLayout(C.GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP)
	NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT = C.GtkNumberUpLayout(C.GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT)
	NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT = C.GtkNumberUpLayout(C.GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT)
	NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT = C.GtkNumberUpLayout(C.GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT)
	NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT = C.GtkNumberUpLayout(C.GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT)

	// Orientation
	ORIENTATION_HORIZONTAL = C.GtkOrientation(C.GTK_ORIENTATION_HORIZONTAL)
	ORIENTATION_VERTICAL   = C.GtkOrientation(C.GTK_ORIENTATION_VERTICAL)

	// PackDirection
	PACK_DIRECTION_LTR = C.GtkPackDirection(C.GTK_PACK_DIRECTION_LTR)
	PACK_DIRECTION_RTL = C.GtkPackDirection(C.GTK_PACK_DIRECTION_RTL)
	PACK_DIRECTION_TTB = C.GtkPackDirection(C.GTK_PACK_DIRECTION_TTB)
	PACK_DIRECTION_BTT = C.GtkPackDirection(C.GTK_PACK_DIRECTION_BTT)

	// PackType
	PACK_START = C.GtkPackType(C.GTK_PACK_START)
	PACK_END   = C.GtkPackType(C.GTK_PACK_END)

	// PageOrientation
	PAGE_ORIENTATION_PORTRAIT          = C.GtkPageOrientation(C.GTK_PAGE_ORIENTATION_PORTRAIT)
	PAGE_ORIENTATION_LANDSCAPE         = C.GtkPageOrientation(C.GTK_PAGE_ORIENTATION_LANDSCAPE)