summaryrefslogtreecommitdiff
path: root/sysdata_unix.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-04-01 16:30:38 -0400
committerPietro Gagliardi <[email protected]>2014-04-01 16:30:38 -0400
commit81153617dcfd1e30e75b7adbe29967088fdea410 (patch)
treeccf79e7627e7c02674a12f74a2e216b443b1bd88 /sysdata_unix.go
parenta003ff62d518dcd5bfedb219ecae26fe89ae9af3 (diff)
Got rid of gtkWidget and changed to using *C.GtkWidget everywhere. This gets rid of some of the casting functions and invocations of said functions, and only adds sysdata_unix.go to the cgo list.
Diffstat (limited to 'sysdata_unix.go')
-rw-r--r--sysdata_unix.go34
1 files changed, 19 insertions, 15 deletions
diff --git a/sysdata_unix.go b/sysdata_unix.go
index be9a827..d60bef4 100644
--- a/sysdata_unix.go
+++ b/sysdata_unix.go
@@ -8,29 +8,33 @@ import (
"time"
)
+// #cgo pkg-config: gtk+-3.0
+// #include "gtk_unix.h"
+import "C"
+
type sysData struct {
cSysData
- widget *gtkWidget
- container *gtkWidget // for moving
+ widget *C.GtkWidget
+ container *C.GtkWidget // for moving
pulse chan bool // for sysData.progressPulse()
}
type classData struct {
- make func() *gtkWidget
- makeAlt func() *gtkWidget
- setText func(widget *gtkWidget, text string)
- text func(widget *gtkWidget) string
- append func(widget *gtkWidget, text string)
- insert func(widget *gtkWidget, index int, text string)
- selected func(widget *gtkWidget) int
- selMulti func(widget *gtkWidget) []int
- smtexts func(widget *gtkWidget) []string
- delete func(widget *gtkWidget, index int)
- len func(widget *gtkWidget) int
+ make func() *C.GtkWidget
+ makeAlt func() *C.GtkWidget
+ setText func(widget *C.GtkWidget, text string)
+ text func(widget *C.GtkWidget) string
+ append func(widget *C.GtkWidget, text string)
+ insert func(widget *C.GtkWidget, index int, text string)
+ selected func(widget *C.GtkWidget) int
+ selMulti func(widget *C.GtkWidget) []int
+ smtexts func(widget *C.GtkWidget) []string
+ delete func(widget *C.GtkWidget, index int)
+ len func(widget *C.GtkWidget) int
// ...
signals callbackMap
- child func(widget *gtkWidget) *gtkWidget
+ child func(widget *C.GtkWidget) *C.GtkWidget
childsigs callbackMap
}
@@ -110,7 +114,7 @@ var classTypes = [nctypes]*classData{
func (s *sysData) make(initText string, window *sysData) error {
ct := classTypes[s.ctype]
- ret := make(chan *gtkWidget)
+ ret := make(chan *C.GtkWidget)
defer close(ret)
uitask <- func() {
if s.alternate {