Here is a snippet
#include <gtk/gtk.h>
enum {
FIRST_COLUMN,
NUM_COLS
};
static void startapp(GtkApplication *app)
{
GtkTreeIter iter;
GtkWindow *window = (GtkWindow*)gtk_window_new();
GtkListStore *store = gtk_list_store_new(NUM_COLS, G_TYPE_STRING);
GtkWidget *combo = gtk_combo_box_new_with_model_and_entry((GtkTreeModel*)store);
gtk_window_set_application(window, app);
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, FIRST_COLUMN, "Foo", -1);
gtk_window_set_child(window, combo);
gtk_window_present(window);
}
int main (int response, char **name)
{
GtkApplication *app = gtk_application_new ("org.foo", G_APPLICATION_FLAGS_NONE);
g_signal_connect(app, "activate", (GCallback)startapp, NULL);
response = g_application_run((GApplication*)app, response, name);
g_object_unref(app);
return response;
}
I can create rows but cant seem to put data in them. My combo box drops down with an empty list.