g-Off.net | Geoffrey Foster


18
Mar/09
0

Cappuccino/Objective-J and URLTextField

I wanted to display a link in a Cappuccino web application but there doesn't seem to be a very "nice" way of doing that so I wrote up the URLTextField class. It's basically a regular CPTextField but the CPTextFields DOMElement is wrapped in another DOMElement that provides the anchor tag. Use it like a normal CPTextField and call setStringValue: with the text you'd like displayed for the link, and use setLink: with a valid URL to set the link. A convenience initWithFrame:link:title: is also available that sets it all up from the get-go.