diff options
| author | Pietro Gagliardi <[email protected]> | 2018-08-26 13:33:54 -0400 | 
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2018-08-26 13:33:54 -0400 | 
| commit | 1095719d84a6ac5f90eefe8e23913f3e09ad692d (patch) | |
| tree | ca7352bf6922e3f0bcf1ee4d5007c8515b681729 | |
| parent | 2bc76219286dfe39949772ceee4dbd9560ec2c1f (diff) | |
Migrated more controls.
| -rw-r--r-- | combobox.go (renamed from BBB_GOFILES/combobox.go) | 11 | ||||
| -rw-r--r-- | editablecombobox.go (renamed from BBB_GOFILES/editablecombobox.go) | 11 | ||||
| -rw-r--r-- | entry.go (renamed from BBB_GOFILES/entry.go) | 11 | ||||
| -rw-r--r-- | form.go (renamed from BBB_GOFILES/form.go) | 2 | ||||
| -rw-r--r-- | grid.go (renamed from BBB_GOFILES/grid.go) | 2 | ||||
| -rw-r--r-- | group.go (renamed from BBB_GOFILES/group.go) | 2 | ||||
| -rw-r--r-- | label.go (renamed from BBB_GOFILES/label.go) | 2 | ||||
| -rw-r--r-- | pkgui.c | 15 | ||||
| -rw-r--r-- | pkgui.h | 14 | ||||
| -rw-r--r-- | progressbar.go (renamed from BBB_GOFILES/progressbar.go) | 2 | 
10 files changed, 46 insertions, 26 deletions
diff --git a/BBB_GOFILES/combobox.go b/combobox.go index 1e381de..60df08a 100644 --- a/BBB_GOFILES/combobox.go +++ b/combobox.go @@ -6,10 +6,7 @@ import (  	"unsafe"  ) -// #include "ui.h" -// extern void doComboboxOnSelected(uiCombobox *, void *); -// // see golang/go#19835 -// typedef void (*comboboxCallback)(uiCombobox *, void *); +// #include "pkgui.h"  import "C"  // Combobox is a Control that represents a drop-down list of strings @@ -27,7 +24,7 @@ func NewCombobox() *Combobox {  	c.c = C.uiNewCombobox() -	C.uiComboboxOnSelected(c.c, C.comboboxCallback(C.doComboboxOnSelected), nil) +	C.pkguiComboboxOnSelected(c.c)  	c.ControlBase = NewControlBase(c, uintptr(unsafe.Pointer(c.c)))  	return c @@ -58,8 +55,8 @@ func (c *Combobox) OnSelected(f func(*Combobox)) {  	c.onSelected = f  } -//export doComboboxOnSelected -func doComboboxOnSelected(cc *C.uiCombobox, data unsafe.Pointer) { +//export pkguiDoComboboxOnSelected +func pkguiDoComboboxOnSelected(cc *C.uiCombobox, data unsafe.Pointer) {  	c := ControlFromLibui(uintptr(unsafe.Pointer(cc))).(*Combobox)  	if c.onSelected != nil {  		c.onSelected(c) diff --git a/BBB_GOFILES/editablecombobox.go b/editablecombobox.go index 1242928..9c0d9d0 100644 --- a/BBB_GOFILES/editablecombobox.go +++ b/editablecombobox.go @@ -6,10 +6,7 @@ import (  	"unsafe"  ) -// #include "ui.h" -// extern void doEditableComboboxOnChanged(uiEditableCombobox *, void *); -// // see golang/go#19835 -// typedef void (*editableComboboxCallback)(uiEditableCombobox *, void *); +// #include "pkgui.h"  import "C"  // EditableCombobox is a Control that represents a drop-down list @@ -27,7 +24,7 @@ func NewEditableCombobox() *EditableCombobox {  	c.c = C.uiNewEditableCombobox() -	C.uiEditableComboboxOnChanged(c.c, C.editableComboboxCallback(C.doEditableComboboxOnChanged), nil) +	C.pkguiEditableComboboxOnChanged(c.c)  	c.ControlBase = NewControlBase(c, uintptr(unsafe.Pointer(c.c)))  	return c @@ -63,8 +60,8 @@ func (e *EditableCombobox) OnChanged(f func(*EditableCombobox)) {  	e.onChanged = f  } -//export doEditableComboboxOnChanged -func doEditableComboboxOnChanged(cc *C.uiEditableCombobox, data unsafe.Pointer) { +//export pkguiDoEditableComboboxOnChanged +func pkguiDoEditableComboboxOnChanged(cc *C.uiEditableCombobox, data unsafe.Pointer) {  	e := ControlFromLibui(uintptr(unsafe.Pointer(cc))).(*EditableCombobox)  	if e.onChanged != nil {  		e.onChanged(e) diff --git a/BBB_GOFILES/entry.go b/entry.go index 52da537..00c7dd7 100644 --- a/BBB_GOFILES/entry.go +++ b/entry.go @@ -10,10 +10,7 @@ import (  	"unsafe"  ) -// #include "ui.h" -// extern void doEntryOnChanged(uiEntry *, void *); -// // see golang/go#19835 -// typedef void (*entryCallback)(uiEntry *, void *); +// #include "pkgui.h"  import "C"  // Entry is a Control that represents a space that the user can @@ -29,7 +26,7 @@ func finishNewEntry(ee *C.uiEntry) *Entry {  	e.e = ee -	C.uiEntryOnChanged(e.e, C.entryCallback(C.doEntryOnChanged), nil) +	C.pkguiEntryOnChanged(e.e)  	e.ControlBase = NewControlBase(e, uintptr(unsafe.Pointer(e.e)))  	return e @@ -74,8 +71,8 @@ func (e *Entry) OnChanged(f func(*Entry)) {  	e.onChanged = f  } -//export doEntryOnChanged -func doEntryOnChanged(ee *C.uiEntry, data unsafe.Pointer) { +//export pkguiDoEntryOnChanged +func pkguiDoEntryOnChanged(ee *C.uiEntry, data unsafe.Pointer) {  	e := ControlFromLibui(uintptr(unsafe.Pointer(ee))).(*Entry)  	if e.onChanged != nil {  		e.onChanged(e) diff --git a/BBB_GOFILES/form.go b/form.go index 6f8a282..aef7597 100644 --- a/BBB_GOFILES/form.go +++ b/form.go @@ -6,7 +6,7 @@ import (  	"unsafe"  ) -// #include "ui.h" +// #include "pkgui.h"  import "C"  // Form is a Control that holds a group of Controls vertically diff --git a/BBB_GOFILES/grid.go b/grid.go index a1985fc..7a027a8 100644 --- a/BBB_GOFILES/grid.go +++ b/grid.go @@ -6,7 +6,7 @@ import (  	"unsafe"  ) -// #include "ui.h" +// #include "pkgui.h"  import "C"  // Grid is a Control that arranges other Controls in a grid. diff --git a/BBB_GOFILES/group.go b/group.go index 6992948..4aaa24a 100644 --- a/BBB_GOFILES/group.go +++ b/group.go @@ -6,7 +6,7 @@ import (  	"unsafe"  ) -// #include "ui.h" +// #include "pkgui.h"  import "C"  // Group is a Control that holds another Control and wraps it around diff --git a/BBB_GOFILES/label.go b/label.go index cac7680..09d0b3c 100644 --- a/BBB_GOFILES/label.go +++ b/label.go @@ -6,7 +6,7 @@ import (  	"unsafe"  ) -// #include "ui.h" +// #include "pkgui.h"  import "C"  // Label is a Control that represents a line of text that cannot be @@ -36,3 +36,18 @@ void pkguiCheckboxOnToggled(uiCheckbox *c)  {  	uiCheckboxOnToggled(c, pkguiDoCheckboxOnToggled, NULL);  } + +void pkguiComboboxOnSelected(uiCombobox *c) +{ +	uiComboboxOnSelected(c, pkguiDoComboboxOnSelected, NULL); +} + +void pkguiEditableComboboxOnChanged(uiEditableCombobox *c) +{ +	uiEditableComboboxOnChanged(c, pkguiDoEditableComboboxOnChanged, NULL); +} + +void pkguiEntryOnChanged(uiEntry *e) +{ +	uiEntryOnChanged(e, pkguiDoEntryOnChanged, NULL); +} @@ -1,4 +1,7 @@  // 12 august 2018 +#ifndef pkguiHFileIncluded +#define pkguiHFileIncluded +  #include <stdlib.h>  #include "ui.h" @@ -16,3 +19,14 @@ extern void pkguiButtonOnClicked(uiButton *b);  // checkbox.go  extern void pkguiCheckboxOnToggled(uiCheckbox *c); + +// combobox.go +extern void pkguiComboboxOnSelected(uiCombobox *c); + +// editablecombobox.go +extern void pkguiEditableComboboxOnChanged(uiEditableCombobox *c); + +// entry.go +extern void pkguiEntryOnChanged(uiEntry *e); + +#endif diff --git a/BBB_GOFILES/progressbar.go b/progressbar.go index f58976f..4c771df 100644 --- a/BBB_GOFILES/progressbar.go +++ b/progressbar.go @@ -6,7 +6,7 @@ import (  	"unsafe"  ) -// #include "ui.h" +// #include "pkgui.h"  import "C"  // ProgressBar is a Control that represents a horizontal bar that  | 
