Re: Can I subclass text field in NSForm? Drawing 3D rectangle
Re: Can I subclass text field in NSForm? Drawing 3D rectangle
- Subject: Re: Can I subclass text field in NSForm? Drawing 3D rectangle
- From: "M. Uli Kusterer" <email@hidden>
- Date: Tue, 18 Jan 2005 14:10:02 +0100
At 12:26 Uhr +0100 18.01.2005, Magnus Strand wrote:
I would like to know if I can I subclass the text fields in NSForm?
I would like to use my own subclass of NSTextView.
An NSForm contains NSTextFieldCells. So, either set it to use your
custom cell subclass, or replace the field editor for your window
with your NSTextView subclass.
I also wonder how to draw a 3d rectangle that NSTextField has as frame?
There's no Cocoa API that does this correctly right now. There is a
function to draw a next-style text field box, but that looks
different enough from Aqua's that it doesn't really work.
You can, however, use Carbon APIs to do this. There's the older
Appearance APIs (which would require you to set up a Quickdraw port
for the current Quartz graphics context, though). If you can require
10.3 (or maybe it's already in 10.2), you could use the HIToolbox's
HIThemeDraw APIs. Those take a Quartz CGContext and give you a lot of
flexibility for drawing edit field boxes, slider and scrollbar parts
etc.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden