From 4fc3cb1d0055706c4d62d61a165779a71e6fa2fd Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 16 Feb 2014 18:41:29 -0500 Subject: Added Checkbox to GTK+. Also added a TODO about crashes. --- sysdata_unix.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sysdata_unix.go') 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 { -- cgit v1.2.3