Hyperlink text in OSX app?

Discussion in 'Mac Programming' started by fbs419, Sep 9, 2012.

  1. fbs419 macrumors newbie

    Sep 9, 2012
    I'm new to Cocoa/Interface builder, and all I'm trying to do is have some hyperlinked text on the bottom of a panel. There doesn't seem to be a hyperlink control in the object library. What is the best way to do this?

    A button linked to an action (if so, how do you make button look like a link)?
    A text field with some sort of attributes?
    Another view of some sort?
    Another possibility?

    It's probably something simple, but I just haven't found a definitive answer. My app needs to be backward compatible to 10.5 (maybe 10.6)

  2. chown33 macrumors 604

    Aug 9, 2009
    descending into the Maelström
    The user clicks the hyperlink, and then what happens?

    Is the content displayed in another app? A new window? A view of the current window?

    The WebView class can present HTML text, which permits hyperlinks. Look at that.

    Also see this:

    Found by googling NSButton hyperlink, and reading a few of the top 10 search results.
  3. Sydde macrumors 68020


    Aug 17, 2009
    Velvet Green
    If you just want some text in the window frame area to effect an action, you can create a borderless button that looks like ordinary text.

    In one app, I wrote the help files in Text Edit as RTF files in which I included hyperlinks that I was able to respond to through a delegate to the text view, if that is more like what you want to do.
  4. fbs419 thread starter macrumors newbie

    Sep 9, 2012
  5. gnasher729 macrumors P6


    Nov 25, 2005
    Typically when a link is clicked, the font should change somehow so the user can see which links have been clicked and which ones happened. I'd look if there are options to turn this off, or to set a font for clicked links.

Share This Page