Added GTK+ LineEdit. It appears there's something weird happening now...

This commit is contained in:
Pietro Gagliardi 2014-02-16 21:40:59 -05:00
parent bce4c19fdd
commit 6bf0b00aa3
2 changed files with 19 additions and 3 deletions

View File

@ -166,3 +166,18 @@ func gtk_combo_box_get_active(widget *gtkWidget) int {
func gtk_combo_box_text_remove(widget *gtkWidget, index int) {
C.gtk_combo_box_text_remove((*C.GtkComboBoxText)(unsafe.Pointer(widget)), C.gint(index))
}
func gtk_entry_new() *gtkWidget {
return (*gtkWidget)(unsafe.Pointer(C.gtk_entry_new()))
}
func gtk_entry_set_text(widget *gtkWidget, text string) {
ctext := C.CString(text)
defer C.free(unsafe.Pointer(ctext))
C.gtk_entry_set_text((*C.GtkEntry)(unsafe.Pointer(widget)),
(*C.gchar)(unsafe.Pointer(ctext)))
}
func gtk_entry_get_text(widget *gtkWidget) string {
return C.GoString((*C.char)(unsafe.Pointer(C.gtk_entry_get_text((*C.GtkEntry)(unsafe.Pointer(widget))))))
}

View File

@ -79,9 +79,7 @@ var classTypes = [nctypes]*classData{
},
c_combobox: &classData{
make: gtk_combo_box_text_new,
// TODO creating an editable combobox causes GtkFixed to fail spectacularly for some reason
// makeAlt: gtk_combo_box_text_new_with_entry,
makeAlt: gtk_combo_box_text_new,
makeAlt: gtk_combo_box_text_new_with_entry,
// TODO setText
text: gtk_combo_box_text_get_active_text,
append: gtk_combo_box_text_append_text,
@ -90,6 +88,9 @@ var classTypes = [nctypes]*classData{
delete: gtk_combo_box_text_remove,
},
c_lineedit: &classData{
make: gtk_entry_new,
setText: gtk_entry_set_text,
text: gtk_entry_get_text,
},
c_label: &classData{
},