text view drawing upside down... HELP!
text view drawing upside down... HELP!
- Subject: text view drawing upside down... HELP!
- From: Salánki Benjámin <email@hidden>
- Date: Thu, 13 Feb 2003 17:45:30 +0100
Hi,
I wrote some code that should make an image from a text view, but
somehow the image starts drawing the text from the lower left corner,
so I get the whole text, but the first line is on the last line, the
second line before the last line and so on. This is totally beyond me.
can anyone please help me?
Thanks,
Ben
NSTextView* theTextView = [[NSTextView alloc] initWithFrame:[theButton
frame]];
[theTextView setString:[[NSPasteboard generalPasteboard]
stringForType:NSStringPboardType]];
NSImage* theImage = [[NSImage alloc] initWithSize:[theButton
frame].size];
[theImage lockFocus];
[theTextView drawRect:[theButton frame]];
[theImage unlockFocus];
[theButton setImage:theImage];
[theTextView release];
theTextView = nil;
[theImage release];
theImage = nil;
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.