From ee23690f79ece596f678c7b364a54e7dbca92320 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 16 Feb 2014 19:50:52 -0500 Subject: Added GTK+ comboboxes. ...and THESE aren't being positioned properly, sigh... --- gtkcalls_unix.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'gtkcalls_unix.go') diff --git a/gtkcalls_unix.go b/gtkcalls_unix.go index 642b34b..fbea882 100644 --- a/gtkcalls_unix.go +++ b/gtkcalls_unix.go @@ -132,3 +132,37 @@ func gtk_check_button_new() *gtkWidget { func gtk_toggle_button_get_active(widget *gtkWidget) bool { return fromgbool(C.gtk_toggle_button_get_active((*C.GtkToggleButton)(unsafe.Pointer(widget)))) } + +func gtk_combo_box_text_new() *gtkWidget { + return (*gtkWidget)(unsafe.Pointer(C.gtk_combo_box_text_new())) +} + +func gtk_combo_box_text_new_with_entry() *gtkWidget { + return (*gtkWidget)(unsafe.Pointer(C.gtk_combo_box_text_new_with_entry())) +} + +func gtk_combo_box_text_get_active_text(widget *gtkWidget) string { + return C.GoString((*C.char)(unsafe.Pointer(C.gtk_combo_box_text_get_active_text((*C.GtkComboBoxText)(unsafe.Pointer(widget)))))) +} + +func gtk_combo_box_text_append_text(widget *gtkWidget, text string) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + C.gtk_combo_box_text_append_text((*C.GtkComboBoxText)(unsafe.Pointer(widget)), + (*C.gchar)(unsafe.Pointer(ctext))) +} + +func gtk_combo_box_text_insert_text(widget *gtkWidget, index int, text string) { + ctext := C.CString(text) + defer C.free(unsafe.Pointer(ctext)) + C.gtk_combo_box_text_insert_text((*C.GtkComboBoxText)(unsafe.Pointer(widget)), + C.gint(index), (*C.gchar)(unsafe.Pointer(ctext))) +} + +func gtk_combo_box_get_active(widget *gtkWidget) int { + return int(C.gtk_combo_box_get_active((*C.GtkComboBox)(unsafe.Pointer(widget)))) +} + +func gtk_combo_box_text_remove(widget *gtkWidget, index int) { + C.gtk_combo_box_text_remove((*C.GtkComboBoxText)(unsafe.Pointer(widget)), C.gint(index)) +} -- cgit v1.2.3