Mark Tracy wrote:
The change you made has broken one of my programs. I am printing
from a
windowless custom view because I want to lay out the report for paper
not the screen. Maybe not a wise strategy, but certainly not an
illegal
one. This works fine for Cocoa and for previous editions of GNUstep.
In svn 24892, NSView.m line 1900, there is:
- (void) lockFocusInRect: (NSRect)rect
{
[self _lockFocusInContext: [_window graphicsContext] inRrect:
rect]
}
In my program, since the view is not associated with a window, nil is
passed, and I get a segfault trying to read the context.
I changed it to read:
- (void) lockFocusInRect: (NSRect)rect
{
NSGraphicsContext *ctxt =
(_window ? [_window graphicsContext] : GSCurrentContext() );
[self _lockFocusInContext: ctxt inRect: rect];
}
This appears to solve my problem, but it should be reviewed by
someone
who has a deeper knowledge.
Hi Mark,
thank you very much for this bug report. It shows that somebody is
using
the print functionality in GNUstep. What you are doing is quite
legitimate and GNUstep has to support it.
I have tried to correct the problem you found in a slightly different
way. Could you please have a go with current SVN source and report
back,
if it still fails? There will be a couple of further changes to the
graphics context handling in the next weeks. I try to do this big
change
rather smoothly, but you already discovered the first error here. So
please test this from time to time for new errors.
Cheers,
Fred