diff options
| -rw-r--r-- | gtkcalls_unix.go | 8 | ||||
| -rw-r--r-- | sysdata_unix.go | 10 | ||||
| -rw-r--r-- | todo.md | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/gtkcalls_unix.go b/gtkcalls_unix.go index 115060c..aba4732 100644 --- a/gtkcalls_unix.go +++ b/gtkcalls_unix.go @@ -114,3 +114,11 @@ func gtk_button_set_label(button *gtkWidget, label string) { C.gtk_button_set_label((*C.GtkButton)(unsafe.Pointer(button)), (*C.gchar)(unsafe.Pointer(clabel))) } + +func gtk_check_button_new() *gtkWidget { + return (*gtkWidget)(unsafe.Pointer(C.gtk_check_button_new())) +} + +func gtk_toggle_button_get_active(widget *gtkWidget) bool { + return fromgbool(C.gtk_toggle_button_get_active((*C.GtkToggleButton)(unsafe.Pointer(widget)))) +} diff --git a/sysdata_unix.go b/sysdata_unix.go index bf6ce49..f2aef50 100644 --- a/sysdata_unix.go +++ b/sysdata_unix.go @@ -65,6 +65,8 @@ var classTypes = [nctypes]*classData{ }, }, c_checkbox: &classData{ + make: gtk_check_button_new, + setText: gtk_button_set_label, }, c_combobox: &classData{ }, @@ -165,8 +167,12 @@ if classTypes[s.ctype] == nil || classTypes[s.ctype].setText == nil { return nil } func (s *sysData) isChecked() bool { - // TODO - return false + ret := make(chan bool) + defer close(ret) + uitask <- func() { + ret <- gtk_toggle_button_get_active(s.widget) + } + return <-ret } func (s *sysData) text() string { @@ -28,6 +28,8 @@ super ultra important things: - 64-bit doesn't work, period: it crashes in malloc in wine with heap corruption warnings aplenty during DLL loading; in windows 7 CreateWindowExW complains about an unregistered window class, yet the RegisterClassW appears to have succeeded and examining the stack in WinDbg indicates the correct class name is being sent (see below) - 32-bit: it works now, but if I save the class name converted to UTF-16 beforehand, wine indicates that the class name is replaced with the window title, so something there is wrong... - handle in-library panics (internal errors) by reporting them to the user +- david wendt is telling me he's getting frequent crashes on his end with the GTK+ amd64 build... + - I get soft deadlock if I mash the Click Me button repeatedly important things: - maybe make it so sysData doesn't need specialized info on every control type? |
