Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 23, 2013, 07:18 PM   #1
larswik
macrumors 65816
 
Join Date: Sep 2006
Creating button info pop ups

Can someone steer me in the right direction. I have a Mac app that I am finishing up and I want the user to be able to hover the mouse over a button for a couple seconds and then have a info window pop up to let the user know what that button is for.

Are there any links or tutorials for this?

Thanks.
__________________
I know more than yesterday.
Lars
larswik is offline   0 Reply With Quote
Old Jul 23, 2013, 07:33 PM   #2
Red Menace
macrumors 6502
 
Join Date: May 2011
Location: Littleton, Colorado, USA
You can set a tooltip in the Interface Builder or programmatically by using NSView's setToolTip: method.
__________________
MacBook Pro / OS X Mavericks (10.9.5) / Xcode 6.0.1 / RubyMotion FTW
Red Menace is offline   0 Reply With Quote
Old Jul 23, 2013, 10:43 PM   #3
larswik
Thread Starter
macrumors 65816
 
Join Date: Sep 2006
Thanks! setToolTip looks to be the a good direction to look into and exactly what I need.
__________________
I know more than yesterday.
Lars
larswik is offline   0 Reply With Quote
Old Jul 24, 2013, 02:05 AM   #4
larswik
Thread Starter
macrumors 65816
 
Join Date: Sep 2006
I just wanted to follow up with some code that made this easy for anyone else looking for information. NSButtons come with a Method called setToolTip. I did not need to create an NSView, it was a simple as...

Code:
[myButton setToolTip:@"Hello World"];
After that you just hover the mouse over the button for a couple of seconds and it displayed the text in a yellow box, exactly what I needed and very easy.
__________________
I know more than yesterday.
Lars
larswik is offline   0 Reply With Quote
Old Jul 24, 2013, 11:45 AM   #5
Red Menace
macrumors 6502
 
Join Date: May 2011
Location: Littleton, Colorado, USA
Don't forget that an object can use methods that it inherits from its parents. The setToolTip method itself is defined in the NSView class, but is inherited by the button (since it has a view).
__________________
MacBook Pro / OS X Mavericks (10.9.5) / Xcode 6.0.1 / RubyMotion FTW
Red Menace is offline   0 Reply With Quote
Old Jul 24, 2013, 04:40 PM   #6
larswik
Thread Starter
macrumors 65816
 
Join Date: Sep 2006
I stand corrected. I thought I was looking in the NSButton Methods and thought I saw setToolTips Method, but I was actually looking in the NSView Class. The code works fine but you are correct, setToolTips is an inherited method from NSView and not in the NSButton Class.

Thanks!
__________________
I know more than yesterday.
Lars
larswik is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Pop Ups in Safari notsomacgenius MacBook Pro 0 Apr 16, 2014 11:56 PM
Random pop ups pogiepnoy iOS 7 0 Sep 24, 2013 10:49 AM
How to close pop-ups? tbear1 Mac Basics and Help 6 May 25, 2013 10:40 PM
Why these pop-ups? Eddyala Mac Basics and Help 2 Jan 7, 2013 05:46 PM
Pop ups help Mercury7 iPhone 0 Sep 26, 2012 10:04 AM

Forum Jump

All times are GMT -5. The time now is 03:06 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC