gnustep-dev
[Top][All Lists]
Advanced

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

Re: Changes to graphic context handling


From: Fred Kiefer
Subject: Re: Changes to graphic context handling
Date: Mon, 19 Mar 2007 14:29:37 +0100
User-agent: Thunderbird 1.5.0.10 (X11/20060911)

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




reply via email to

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