Exemplo n.º 1
0
func gtk_entry_new() *C.GtkWidget {
	e := C.gtk_entry_new()
	// allows the GtkEntry to be resized with the window smaller than what it thinks the size should be
	// thanks to Company in irc.gimp.net/#gtk+
	C.gtk_entry_set_width_chars(togtkentry(e), 0)
	return e
}
Exemplo n.º 2
0
func gtk_combo_box_text_new_with_entry() *C.GtkWidget {
	w := C.gtk_combo_box_text_new_with_entry()
	// we need to set the entry's width-chars to achieve the arbitrary sizing we want
	// thanks to tristan in irc.gimp.net/#gtk+
	// in my tests, this is sufficient to get the effect we want; setting the cell renderer isn't necessary like it is with an entry-less combobox
	entry := togtkentry(C.gtk_bin_get_child((*C.GtkBin)(unsafe.Pointer(w))))
	C.gtk_entry_set_width_chars(entry, 0)
	return w
}