]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/textureentry.cpp
GTK: wrap gtk_widget_set_size_request
[xonotic/netradiant.git] / radiant / textureentry.cpp
index f692717eea64ba3a4c5434a1dd5edaea3b400009..07fb0235f71e60c8cbfd19d08f1e36599826c67b 100644 (file)
 
 #include <gtk/gtk.h>
 
-template
-class EntryCompletion<TextureNameList>;
-
-template
-class EntryCompletion<ShaderList>;
-
 template<class StringList>
 void EntryCompletion<StringList>::connect(ui::Entry entry)
 {
@@ -42,16 +36,14 @@ void EntryCompletion<StringList>::connect(ui::Entry entry)
 
     auto completion = ui::EntryCompletion(gtk_entry_completion_new());
     gtk_entry_set_completion(entry, completion);
-    gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(m_store));
+    gtk_entry_completion_set_model(completion, m_store);
     gtk_entry_completion_set_text_column(completion, 0);
 }
 
 template<class StringList>
 void EntryCompletion<StringList>::append(const char *string)
 {
-    GtkTreeIter iter;
-    gtk_list_store_append(m_store, &iter);
-    gtk_list_store_set(m_store, &iter, 0, string, -1);
+    m_store.append(0, string);
 }
 
 template<class StringList>
@@ -63,7 +55,7 @@ void EntryCompletion<StringList>::fill()
 template<class StringList>
 void EntryCompletion<StringList>::clear()
 {
-    gtk_list_store_clear(m_store);
+    m_store.clear();
 }
 
 template<class StringList>
@@ -72,3 +64,9 @@ void EntryCompletion<StringList>::update()
     clear();
     fill();
 }
+
+template
+class EntryCompletion<TextureNameList>;
+
+template
+class EntryCompletion<ShaderList>;