[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
NSTableView, rows in reverse order
From: |
Marko Riedel |
Subject: |
NSTableView, rows in reverse order |
Date: |
Wed, 23 Jul 2008 22:48:41 +0000 (GMT) |
Hi all,
I've come across something where I'm not sure if it's a bug or a feature.
The following code fragment draws an existing tableview into a bitmap, for
later export as TIFF and conversion to PostScript.
NSRect box = [table bounds],
hbox = [[table headerView] bounds];
NSRect winrect = box;
winrect.size.height += hbox.size.height;
NSWindow *win =
[[NSWindow alloc]
initWithContentRect:winrect
styleMask:0
backing:NSBackingStoreRetained
defer:NO];
[[win contentView] lockFocus];
[table drawRect:box];
[NSGraphicsContext saveGraphicsState];
PStranslate(0, box.size.height);
[[table headerView] drawRect:hbox];
[NSGraphicsContext restoreGraphicsState];
NSBitmapImageRep
*boxRep = [NSBitmapImageRep alloc];
[boxRep
initWithFocusedViewRect:[[win contentView] bounds]];
AUTORELEASE(boxRep);
[[win contentView] unlockFocus];
I guess I could replace the last "[[win contentView] bounds]" with "winrect"
but that's not relevant here.
The phenomenon I'm observing is that the tableview draws the rows in reverse
order, from bottom to top instead of from top to bottom. So the output does not
match what the user sees on screen. The row that comes first on screen is drawn
last in the bitmap.
Curious, to say the least.
Best regards,
Marko
+-------------------------------------------------------------+
| Marko Riedel, EDV Neue Arbeit gGmbH, markoriedelde@yahoo.de |
| http://www.geocities.com/markoriedelde/index.html |
+-------------------------------------------------------------+
__________________________________________________________
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com
- NSTableView, rows in reverse order,
Marko Riedel <=