File: stack_since_3_12.go

package info (click to toggle)
golang-github-gotk3-gotk3 0.6.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,392 kB
  • sloc: ansic: 914; makefile: 4
file content (32 lines) | stat: -rw-r--r-- 919 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Same copyright and license as the rest of the files in this project
// This file contains accelerator related functions and structures

// +build !gtk_3_6,!gtk_3_8,!gtk_3_10
// not use this: go build -tags gtk_3_8'. Otherwise, if no build tags are used, GTK 3.10

package gtk

// #include <stdlib.h>
// #include <gtk/gtk.h>
// #include "gtk_since_3_10.go.h"
import "C"
import (
	"unsafe"
)

// GetChildByName is a wrapper around gtk_stack_get_child_by_name().
func (v *Stack) GetChildByName(name string) (IWidget, error) {
	cstr := C.CString(name)
	defer C.free(unsafe.Pointer(cstr))
	c := C.gtk_stack_get_child_by_name(v.native(), (*C.gchar)(cstr))
	if c == nil {
		return nil, nilPtrErr
	}
	return castWidget(c)
}

// GetTransitionRunning is a wrapper around gtk_stack_get_transition_running().
func (v *Stack) GetTransitionRunning() bool {
	c := C.gtk_stack_get_transition_running(v.native())
	return gobool(c)
}