discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: empty document at Graphos startup


From: Wolfgang Lux
Subject: Re: empty document at Graphos startup
Date: Mon, 19 Dec 2011 18:50:21 +0100

Riccardo Mottola wrote:

> Hi,
> 
>> I've got Graphos working correctly with GNUstep on OS X again. The problem 
>> was that my GSLPR printer configuration got messed up during an OS X 
>> upgrade. The printer's ppd file was moved to a different place. After 
>> correcting its path in the defaults, Graphos's document windows appear 
>> correctly on my systems.
>> Probably you should check your printer configuration (and maybe handle the 
>> case when no printer is available in -updatePrintInfo: by assuming some 
>> standard page format).
>> 
> 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!

> 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)
or more compactly
    if ((self = [super init]) != nil)

> 3) I also get "Scanner initialised with nil string", I haven't debugged yet 
> where it is coming from.

Wolfgang




reply via email to

[Prev in Thread] Current Thread [Next in Thread]