• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Text URL in Dialog?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text URL in Dialog?


  • Subject: Re: Text URL in Dialog?
  • From: email@hidden
  • Date: Sun, 10 Mar 2002 01:36:49 -0800

What is the best way to put a link to a web site in a sheet?

I'd prefer it too look like just a piece of (hyper) text. My initial
plan was to just put the text in a button and make the button
"Borderless", but I am having a very difficult time getting the
background horizontal lines in the button to line up perfectly with
the background of the sheet it is in. Is there a way to just make a
piece of text "Clickable" alternately is there a tried and true way
of aligning your "transparent" button to the back ground.. the way it
looks in IB is not the way it looks in the sheet.. and nudging up and
down did not seem to help...

If you want this to be nibware, then I don't know of a way, until IB adds support for the link attribute on text (please, god, please...). If you're willing to write code, though, it's pretty easy. Use NSTextView's built-in link-following capability; just make your link text, set it to be blue and underlined, and set your URL on it as the value for NSLinkAttributeName. I posted code to do (roughly) this recently, to this list or macosx-dev.
Making a button is certainly also a possibility, but if you do that, you probably want to just override drawRect: to do your own appearance altogether. (And you might just want to subclass NSControl instead of NSButton).
Which one you do is probably a moot point until your requirements for your link-widget become more stringent...

Ben Haller
Stick Software
_______________________________________________
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.

  • Prev by Date: Re: Multiple windows in a doc based app How-To
  • Next by Date: How to draw a single pixel line?
  • Previous by thread: Re: Text URL in Dialog?
  • Next by thread: Standard Toolbar Icons?
  • Index(es):
    • Date
    • Thread