]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/entityinspector.cpp
minor refactoring
[xonotic/netradiant.git] / radiant / entityinspector.cpp
index a3e445baecf65340d4f814523ac76ea3b2909e93..da097e465e8f82e0c4411a813f80deb6c0ba9727 100644 (file)
@@ -1010,7 +1010,10 @@ void EntityClassList_selectEntityClass(EntityClass* eclass)
       GtkTreeView* view = g_entityClassList;
       GtkTreePath* path = gtk_tree_model_get_path(model, &iter);
       gtk_tree_selection_select_path(gtk_tree_view_get_selection(view), path);
-      gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0);
+      if(GTK_WIDGET_REALIZED(view))
+      {
+        gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0);
+      }
       gtk_tree_path_free(path);
       good = FALSE;
     }
@@ -1361,7 +1364,10 @@ static gint EntityClassList_keypress(GtkWidget* widget, GdkEventKey* event, gpoi
       {
         GtkTreePath* path = gtk_tree_model_get_path(model, &iter);
         gtk_tree_selection_select_path(gtk_tree_view_get_selection(view), path);
-        gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0);
+        if(GTK_WIDGET_REALIZED(view))
+        {
+          gtk_tree_view_scroll_to_cell(view, path, 0, FALSE, 0, 0);
+        }
         gtk_tree_path_free(path);
         count = 1;
       }
@@ -1687,7 +1693,8 @@ GtkWidget* EntityInspector_constructWindow(GtkWindow* toplevel)
   g_entityInspector_windowConstructed = true;
   EntityClassList_fill();
 
-  GlobalSelectionSystem().addSelectionChangeCallback(FreeCaller1<const Selectable&, EntityInspector_selectionChanged>());
+  typedef FreeCaller1<const Selectable&, EntityInspector_selectionChanged> EntityInspectorSelectionChangedCaller;
+  GlobalSelectionSystem().addSelectionChangeCallback(EntityInspectorSelectionChangedCaller());
   GlobalEntityCreator().setKeyValueChangedFunc(EntityInspector_keyValueChanged);
 
   // hack