|
From: | Riccardo Mottola |
Subject: | Re: empty document at Graphos startup |
Date: | Tue, 20 Dec 2011 09:28:53 +0100 |
User-agent: | Mozilla/5.0 (X11; NetBSD i386; rv:8.0) Gecko/20111219 Thunderbird/8.0 |
Hi, thanks for looking into the issue.
Well, initWithFrame of GRDocView essentially ignores the parameter and sets some default stuff.I guarded updatePrintInfo so that returns without setting the page rect if the information is clearly invalid (nil or<= 0). However, this doesn't fix the problem (commited though, it doesn't harm surely). the pageRectSize is set in the designated initializer. pageRect = NSMakeRect(0, 0, 695, 942); line 47 I notice two interesting thigns: 1) updatePrintInfo is not called on startup witha new blank document for me.In that case you should get a log message "printInfo nil!". It means that the document's -printInfo method returns nil (maybe because you have no printer configured?). In that case the size of the GRDocView created in -init is not changed and that view is created with (0,0,0,0) so it is certainly not visible!
I don't get printInfo nil. My startup looks like: grid$ Graphos.app/Graphos 2011-12-20 09:25:31.023 Graphos[5151] No theme named 'Neos' found Xlib: extension "MIT-SHM" missing on display "dev11:0.0". 2011-12-20 09:25:31.418 Graphos[5151] initing doc view with win 2011-12-20 09:25:31.438 Graphos[5151] initing doc view with win 2011-12-20 09:25:31.518 Graphos[5151] Scanner initialised with nil string 2011-12-20 09:25:31.536 Graphos[5151] initing GRToolsWindow 2011-12-20 09:25:31.543 Graphos[5151] initing GRToolsView 2011-12-20 09:25:31.549 Graphos[5151] inited GRToolsWindow
Yes, that must be a leftover of the old code I refactored. My usual style is the verbose line you show here. I fixed that. It did not help though, but thanks for the catch.2) the init method is called twice (I get "initing doc view with win" on the console)Of course it gets called twice. Once for the GRDocView that you create in GRDocument's -init method and once for the GRDocView that is unarchived from the .gorm file. Since you don't create a window in the -init method, I think it is pointless to create a GRDocView there. You really should use the document view that is present in the gorm file (by linking it to the docView attribute of the document in Gorm). BTW, I've noticed this bogus code in the -init method: [super init]; if (self) This should read self = [super init]; if (self)
I'll check in the double initialization too. It is probably just useless and not harmful.
Riccardo
3) I also get "Scanner initialised with nil string", I haven't debugged yet where it is coming from.
Do you get this one? it might be a clue...
[Prev in Thread] | Current Thread | [Next in Thread] |