|Oct 22, 2012, 11:49 PM||#1|
Need to click once on hyperlink before it activates?
I have a panel with a hyperlink on it. I used some code from Technical Q&A1487 (Embedding Hyperlinks in NSTextField and NSTextView), and to get the hand cursor, I tried both a small subclass of NSTextView, implementing resetCursorRects, and the DSClickableURLText class. In both cases, when my panel comes up, I have to click once on the hyperlink before I see the hand cursor and can go to the URL. I call selectText: self (in fact, I have to, or I can't ever get to the URL). I've also tried calling makeFirstResponder on the window. But I still have to click on it once before it works.
Is this just an anomaly in the OS or the kit? Is there a way I can get this to work programmatically, but simulating a click?
|Oct 23, 2012, 03:36 PM||#2|
I did see this post:
You need to use an NSTextView here rather than an NSTextField. The
behavior you are seeing is because an NSTextField is not 'active'
until clicked upon, and then it gets the window's field editor (which
is a shared NSTextView used by all fields on the window), and places
that view on top of the text field and uses it to edit the text. It is
NSTextView that handles the link hand cursor, and et cetera.
Isn't there any way around this? Without the NSTextField subclass code, even though the font changes, at least it goes to the hyperlink on the first click. I tried using an NSTextView, and it wasn't working.
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|Phone acting strange, activates itself help||chestvrg||iPhone||3||Nov 25, 2013 09:49 PM|
|How to remove a hyperlink with the right click||Sudzia||Mac Basics and Help||0||Nov 1, 2013 07:12 AM|
|Hyperlink||shooter28||iPhone Tips, Help and Troubleshooting||1||Jun 24, 2013 03:07 PM|
|AT&T Activates LTE in Philly - Just in time for iPhone 5!||Hitch08||iPhone||33||Sep 23, 2012 09:30 AM|
|Hyperlink App||jones8865||iPad Apps||0||Jul 16, 2012 02:47 AM|
All times are GMT -5. The time now is 01:42 AM.