NSMatrix display problem after changing its frame

  • I need to create a window that will fit the whole screen, this window
    contains an NSMatrix that I need to center after the window creation.
    So far what I'm doing is the following :

    NSWindow * window = [self window];

    NSRect origin = {0.0,0.0};
    NSRect r1 = [[NSScreen mainScreen] frame];
    NSRect r2 = [buttons frame];
    origin.origin.x = (r1.size.width - r2.size.width)/2;
    origin.origin.y = r1.size.height - (r1.size.height + r2.size.height)/2;
    origin.size.width = r2.size.width;
    origin.size.height = r2.size.height;
    [buttons setFrame:origin];

    [window setOpaque:NO];
        [window setHasShadow:YES];
    [window setBackgroundColor:[NSColor colorWithCalibratedWhite:0 alpha:
    0.6]];
    [buttons setNeedsDisplayInRect:origin];
    [[buttons superview] setNeedsDisplay:YES];

    Once the NSMatrix has been moved, the display of the NSMatrix (with
    images) is wrong, has you can see on this image <http://lestang.org/
    nsmatrix-setframe.png
    >, there is a vertical line appearing on the
    left and the right of each cell of the NSMatrix and I cannot figure
    out what is going on.

    Thanks in advance,

    Jean-Baptiste LE STANG
  • On Fri, 21 Sep 2007 12:16:52 +0200, Jean-Baptiste LE STANG
    <lists...> said:
    > Once the NSMatrix has been moved, the display of the NSMatrix (with
    > images) is wrong

    It might help to know what this a matrix *of*. In the past, when I've had
    problems like this, it was because I was doing something wrong in the
    matrix's cell drawing code. m.

    --
    matt neuburg, phd = <matt...>, <http://www.tidbits.com/matt/>
    A fool + a tool + an autorelease pool = cool!
    One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
    AppleScript: the Definitive Guide - Second Edition!
    <http://www.amazon.com/gp/product/0596102119>
previous month september 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Go to today