From 3aa59d4ab9d1217fa47c4b1b265fd435547ed62f Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 8 Mar 2014 16:42:57 -0500 Subject: Added Combobox/Listbox.Len() and its GTK+ implementation. --- gtkcalls_unix.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gtkcalls_unix.go') diff --git a/gtkcalls_unix.go b/gtkcalls_unix.go index 6d9706d..bde6b74 100644 --- a/gtkcalls_unix.go +++ b/gtkcalls_unix.go @@ -155,6 +155,13 @@ func gtk_combo_box_text_remove(widget *gtkWidget, index int) { C.gtk_combo_box_text_remove(togtkcombobox(widget), C.gint(index)) } +func gtkComboBoxLen(widget *gtkWidget) int { + cb := (*C.GtkComboBox)(unsafe.Pointer(widget)) + model := C.gtk_combo_box_get_model(cb) + // this is the same as with a Listbox so + return gtkTreeModelListLen(model) +} + func gtk_entry_new() *gtkWidget { return fromgtkwidget(C.gtk_entry_new()) } -- cgit v1.2.3