I am not sure how else to explain it. I am trying to make a plugin for Safari. There are alot of things I am planning on doing with it, but to start I would like to do some simple things first. So that is why I am trying to draw a rectangle and also output text into the rectangle. Just to do simple output to the browser.
I'd like you to consider what you're interested in doing in more detail. If you're trying to write code to accomplish a goal, you'd better know specifically what you're out to accomplish; I mean
literally know exactly what you're intending to do.
For example, if you want to draw a box on the screen, you're going to need to know the exact pixel dimensions of your box, the color/transparency, whether it has a border, the width and color of that border, and what pixel on the screen it will be be positioned at. You should also know whether that box will be displayed alone or mixed with other graphic objects, and if it is something that the user can manipulate or interact with in any way whatsoever.
So, let's consider your idea. You want a plugin for Safari to draw a rectangle and output text into the rectangle. Is Safari being used only to display your image, or are you going to be drawing over the top of existing web page content? Is the user completely passive or can they somehow interact with the output of your plugin? Why would a user want to install the plugin; what is it that it does for them? I really can't suggest much for you unless you offer some details.
BTW, "deprecated" doesn't mean that it's no longer available. Deprecated methods, classes, etc. are things that have been marked for possible/eventual removal. Therefore, you're free to use deprecated items, but don't assume they're always going to be there. It's a nice way of strongly recommending that you reconsider how you code, because it's going to change at some point in the future.
When you come across deprecated items, you can always safely assume that there's a new, recommended solution that now exists and serves a similar purpose. Some times there's no point in using the newer methods because they require a newer version of the OS and you want to make sure anyone with an older version of the OS can still run your app. An example: I'm working on an app that sub-classes the Cocoa class NSDocument. There's method called "initWithContentsOfFile: ofType:" that I was planning on using, then I learned that it's deprecated in 10.4. After reading the docs, and learning that Apple recommends "initWithContentsOfURL: ofType:error:", I realized that I have to use the deprecated method if I want to support users on version of Mac OS other than 10.4.
I have tried to understand the quickdraw methods
AFAIK, Quickdraw has been deprecated.
when I try to include the quickdraw.h it doesn't find the file to include.
I'd suggest checking through the Apple Developer docs for something called "Drawing and Views Programming Topics for Cocoa." It covers a bunch of the ground rules you should at least be aware of; some of it will be absolutely required knowledge if you're going to continue with your project.
Also, there's a Cocoa class that exists solely to allow using Quickdraw in Cocoa apps. It's called "NSQuickDrawView" and is a sub-class of NSView.
I read that I should use Quartz.
Again, it all depends on what you're looking to accomplish. Here's
an example project that draws a Texas flag. Download and check it out. You might be surprised how little it takes. NOTE: I'm not advocating anything about how I wrote my code. I'm simply sending this as an example of code,
not elegant or ideal code.
Best,
Logicat