diff options
| author | Pietro Gagliardi <[email protected]> | 2014-02-16 19:50:52 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-02-16 19:50:52 -0500 |
| commit | ee23690f79ece596f678c7b364a54e7dbca92320 (patch) | |
| tree | b82fed6dc87099a2cb98dab4e4eb928b608e76ee /gtkcalls_unix.go | |
| parent | 13d4e1d258359b0c45df95ea0c359bd50e07ef85 (diff) | |
Added GTK+ comboboxes. ...and THESE aren't being positioned properly, sigh...
Diffstat (limited to 'gtkcalls_unix.go')
| -rw-r--r-- | gtkcalls_unix.go | 34 |
1 files changed, 34 insertions, 0 deletions
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)) +} |
