File tree Expand file tree Collapse file tree 10 files changed +46
-26
lines changed
Expand file tree Collapse file tree 10 files changed +46
-26
lines changed Original file line number Diff line number Diff line change @@ -6,10 +6,7 @@ import (
66 "unsafe"
77)
88
9- // #include "ui.h"
10- // extern void doComboboxOnSelected(uiCombobox *, void *);
11- // // see golang/go#19835
12- // typedef void (*comboboxCallback)(uiCombobox *, void *);
9+ // #include "pkgui.h"
1310import "C"
1411
1512// Combobox is a Control that represents a drop-down list of strings
@@ -27,7 +24,7 @@ func NewCombobox() *Combobox {
2724
2825 c .c = C .uiNewCombobox ()
2926
30- C .uiComboboxOnSelected (c .c , C . comboboxCallback ( C . doComboboxOnSelected ), nil )
27+ C .pkguiComboboxOnSelected (c .c )
3128
3229 c .ControlBase = NewControlBase (c , uintptr (unsafe .Pointer (c .c )))
3330 return c
@@ -58,8 +55,8 @@ func (c *Combobox) OnSelected(f func(*Combobox)) {
5855 c .onSelected = f
5956}
6057
61- //export doComboboxOnSelected
62- func doComboboxOnSelected (cc * C.uiCombobox , data unsafe.Pointer ) {
58+ //export pkguiDoComboboxOnSelected
59+ func pkguiDoComboboxOnSelected (cc * C.uiCombobox , data unsafe.Pointer ) {
6360 c := ControlFromLibui (uintptr (unsafe .Pointer (cc ))).(* Combobox )
6461 if c .onSelected != nil {
6562 c .onSelected (c )
Original file line number Diff line number Diff line change @@ -6,10 +6,7 @@ import (
66 "unsafe"
77)
88
9- // #include "ui.h"
10- // extern void doEditableComboboxOnChanged(uiEditableCombobox *, void *);
11- // // see golang/go#19835
12- // typedef void (*editableComboboxCallback)(uiEditableCombobox *, void *);
9+ // #include "pkgui.h"
1310import "C"
1411
1512// EditableCombobox is a Control that represents a drop-down list
@@ -27,7 +24,7 @@ func NewEditableCombobox() *EditableCombobox {
2724
2825 c .c = C .uiNewEditableCombobox ()
2926
30- C .uiEditableComboboxOnChanged (c .c , C . editableComboboxCallback ( C . doEditableComboboxOnChanged ), nil )
27+ C .pkguiEditableComboboxOnChanged (c .c )
3128
3229 c .ControlBase = NewControlBase (c , uintptr (unsafe .Pointer (c .c )))
3330 return c
@@ -63,8 +60,8 @@ func (e *EditableCombobox) OnChanged(f func(*EditableCombobox)) {
6360 e .onChanged = f
6461}
6562
66- //export doEditableComboboxOnChanged
67- func doEditableComboboxOnChanged (cc * C.uiEditableCombobox , data unsafe.Pointer ) {
63+ //export pkguiDoEditableComboboxOnChanged
64+ func pkguiDoEditableComboboxOnChanged (cc * C.uiEditableCombobox , data unsafe.Pointer ) {
6865 e := ControlFromLibui (uintptr (unsafe .Pointer (cc ))).(* EditableCombobox )
6966 if e .onChanged != nil {
7067 e .onChanged (e )
Original file line number Diff line number Diff line change @@ -10,10 +10,7 @@ import (
1010 "unsafe"
1111)
1212
13- // #include "ui.h"
14- // extern void doEntryOnChanged(uiEntry *, void *);
15- // // see golang/go#19835
16- // typedef void (*entryCallback)(uiEntry *, void *);
13+ // #include "pkgui.h"
1714import "C"
1815
1916// Entry is a Control that represents a space that the user can
@@ -29,7 +26,7 @@ func finishNewEntry(ee *C.uiEntry) *Entry {
2926
3027 e .e = ee
3128
32- C .uiEntryOnChanged (e .e , C . entryCallback ( C . doEntryOnChanged ), nil )
29+ C .pkguiEntryOnChanged (e .e )
3330
3431 e .ControlBase = NewControlBase (e , uintptr (unsafe .Pointer (e .e )))
3532 return e
@@ -74,8 +71,8 @@ func (e *Entry) OnChanged(f func(*Entry)) {
7471 e .onChanged = f
7572}
7673
77- //export doEntryOnChanged
78- func doEntryOnChanged (ee * C.uiEntry , data unsafe.Pointer ) {
74+ //export pkguiDoEntryOnChanged
75+ func pkguiDoEntryOnChanged (ee * C.uiEntry , data unsafe.Pointer ) {
7976 e := ControlFromLibui (uintptr (unsafe .Pointer (ee ))).(* Entry )
8077 if e .onChanged != nil {
8178 e .onChanged (e )
Original file line number Diff line number Diff line change 66 "unsafe"
77)
88
9- // #include "ui .h"
9+ // #include "pkgui .h"
1010import "C"
1111
1212// Form is a Control that holds a group of Controls vertically
Original file line number Diff line number Diff line change 66 "unsafe"
77)
88
9- // #include "ui .h"
9+ // #include "pkgui .h"
1010import "C"
1111
1212// Grid is a Control that arranges other Controls in a grid.
Original file line number Diff line number Diff line change 66 "unsafe"
77)
88
9- // #include "ui .h"
9+ // #include "pkgui .h"
1010import "C"
1111
1212// Group is a Control that holds another Control and wraps it around
Original file line number Diff line number Diff line change 66 "unsafe"
77)
88
9- // #include "ui .h"
9+ // #include "pkgui .h"
1010import "C"
1111
1212// Label is a Control that represents a line of text that cannot be
Original file line number Diff line number Diff line change @@ -36,3 +36,18 @@ void pkguiCheckboxOnToggled(uiCheckbox *c)
3636{
3737 uiCheckboxOnToggled (c , pkguiDoCheckboxOnToggled , NULL );
3838}
39+
40+ void pkguiComboboxOnSelected (uiCombobox * c )
41+ {
42+ uiComboboxOnSelected (c , pkguiDoComboboxOnSelected , NULL );
43+ }
44+
45+ void pkguiEditableComboboxOnChanged (uiEditableCombobox * c )
46+ {
47+ uiEditableComboboxOnChanged (c , pkguiDoEditableComboboxOnChanged , NULL );
48+ }
49+
50+ void pkguiEntryOnChanged (uiEntry * e )
51+ {
52+ uiEntryOnChanged (e , pkguiDoEntryOnChanged , NULL );
53+ }
Original file line number Diff line number Diff line change 11// 12 august 2018
2+ #ifndef pkguiHFileIncluded
3+ #define pkguiHFileIncluded
4+
25#include <stdlib.h>
36#include "ui.h"
47
@@ -16,3 +19,14 @@ extern void pkguiButtonOnClicked(uiButton *b);
1619
1720// checkbox.go
1821extern void pkguiCheckboxOnToggled (uiCheckbox * c );
22+
23+ // combobox.go
24+ extern void pkguiComboboxOnSelected (uiCombobox * c );
25+
26+ // editablecombobox.go
27+ extern void pkguiEditableComboboxOnChanged (uiEditableCombobox * c );
28+
29+ // entry.go
30+ extern void pkguiEntryOnChanged (uiEntry * e );
31+
32+ #endif
Original file line number Diff line number Diff line change 66 "unsafe"
77)
88
9- // #include "ui .h"
9+ // #include "pkgui .h"
1010import "C"
1111
1212// ProgressBar is a Control that represents a horizontal bar that
You can’t perform that action at this time.
0 commit comments