Fixed buglet in file open action.
[pspp] / src / ui / gui / window-manager.c
index 51fc95a91de9df69f0f26b000a25c4a75f0880a2..2978d7ae8f5c585619c81207084249edcd4743c0 100644 (file)
@@ -105,11 +105,16 @@ window_create (enum window_type type, const gchar *name)
 
   register_window (e);
 
-  gtk_widget_show (e->window);
+  gtk_widget_show (GTK_WIDGET (e->window));
 
   return e;
 }
 
+void
+default_window_name (struct editor_window *w)
+{
+  set_window_name (w, NULL);
+}
 
 static void
 set_window_name (struct editor_window *e,
@@ -118,11 +123,12 @@ set_window_name (struct editor_window *e,
   gchar *title ;
   g_free (e->name);
 
+  e->name = NULL;
 
   if ( name )
     {
-      e->name = g_strdup (name);
-      return ;
+      e->name =  g_strdup (name);
+      return;
     }
 
   switch (e->type )
@@ -145,6 +151,8 @@ set_window_name (struct editor_window *e,
 }
 
 
+/* Set the name of this window based on FILENAME.
+   FILENAME is in "filename encoding" */
 void
 window_set_name_from_filename (struct editor_window *e,
                               const gchar *filename)