Re: Drawing to NSQuickDrawView
Re: Drawing to NSQuickDrawView
- Subject: Re: Drawing to NSQuickDrawView
- From: Ruben Smits <email@hidden>
- Date: Thu, 18 Apr 2002 08:36:53 +0200
On woensdag, april 17, 2002, at 08:17 , cocoa-dev-
email@hidden wrote:
Hi!
I've just started playing around a bit with
Cocoa/InterfaceBuilder/Objective-C and thought I would do a Game Of Life
application.
The main window has a NSQuickDrawView and some buttons... Everything is
pretty much set up as in the CurrencyConverter tutorial.
I have a IBOutlet id myquickdrawview; that I use on the action
- (IBAction)resize:(id)sender
{
void* thePort;
Rect portRect;
[myquickdrawview lockFocus];
thePort = [myquickdrawview qdPort];
SetPort( thePort);
EraseRect( GetPortBounds( thePort, &portRect) );
SysBeep(1);
[myquickdrawview unlockFocus];
}
So when I press the button I get my SysBeep but nothing is drawn... what
am I doing wrong?
//ernie
I had a similar problem. Apple told me that using Carbon functions in a
Cocoa project will work, as long as you don't call GUI-elements in
combination with your Carbon functions.
However, when I started a new Cocoa-project, copied the code (including
Carbon functions) from my non-working project without the GUI, it
worked. After that I created the GUI again and it also worked in my new
project! I don't understand why, but maybe this will work for you too?
_______________________________________________
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.