Added Checkbox to GTK+. Also added a TODO about crashes.
This commit is contained in:
parent
b8f7f4aa6e
commit
4fc3cb1d00
|
@ -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))))
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
2
todo.md
2
todo.md
|
@ -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?
|
||||
|
|
Loading…
Reference in New Issue