I'm not sure Nicola is still around reading his email so I'm posting
this here.

-------- Message original --------
Sujet: Renaissance and document based applications bug
Date : Tue, 17 Apr 2012 22:44:15 +0200
De : Philippe Roussel <p.o.rous...@free.fr>
Pour : Nicola Pero <nicola.p...@meta-innovation.com>

Hi Nicola,

I'm trying to build a small document based application using Renaissance
and I ran into some problems : the title of a document window is
supposed to be automagically set when opening from or saving to a file.

I tried to reproduce the problem with Renaissance's version of Ink and
ran into another problem that you should be able to reproduce : when
opening a file, the document title isn't changed (expected) and the
content of the file isn't displayed in the window.

Long story short, it appears that NSWindowController uses a private flag
nib_is_loaded to indicate if the window is loaded.
GSMarkupWindowController methods don't (and can't) set this flag so some
code paths are never run when using Renaissance.

I'm not sure the following patch is correct but Ink seems to work
correctly with it.

What do you think ?

Thanks,
Philippe

Index: renaissance/Source/TagLibrary/GSMarkupWindowController.h
===================================================================
--- renaissance/Source/TagLibrary/GSMarkupWindowController.h	(révision 35086)
+++ renaissance/Source/TagLibrary/GSMarkupWindowController.h	(copie de travail)
@@ -55,6 +55,8 @@
    * a 'release' message.  Then we destroy the array as well.
    */
   NSArray *_gsMarkupTopLevelObjects;
+
+  BOOL _windowLoaded;
 }
 
 @end
Index: renaissance/Source/TagLibrary/GSMarkupWindowController.m
===================================================================
--- renaissance/Source/TagLibrary/GSMarkupWindowController.m	(révision 35086)
+++ renaissance/Source/TagLibrary/GSMarkupWindowController.m	(copie de travail)
@@ -184,6 +184,10 @@
   ASSIGN (_gsMarkupTopLevelObjects, topLevelObjects);
 }
 
+- (BOOL) isWindowLoaded
+{
+  return _windowLoaded;
+}
 
 - (void) loadWindow
 {
@@ -217,6 +221,7 @@
 		    withZone: [[self owner] zone]])
 	{
 	  [self setTopLevelObjects: topLevelObjects];
+	  _windowLoaded = YES;
 	  return;
 	}
     }
@@ -241,6 +246,7 @@
 		      withZone: [[self owner] zone]])
 	    {
 	      [self setTopLevelObjects: topLevelObjects];
+	      _windowLoaded = YES;
 	      return;
 	    }
       
@@ -252,6 +258,7 @@
 			  withZone: [[self owner] zone]])
 		{
 		  [self setTopLevelObjects: topLevelObjects];
+		  _windowLoaded = YES;
 		  return;
 		}
 	    }

_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to