1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/cocoa/tooltip.mm
3 // Purpose: Cocoa tooltips
8 // Copyright: (c) Ryan Norton
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // ===========================================================================
14 // ===========================================================================
16 // ---------------------------------------------------------------------------
18 // ---------------------------------------------------------------------------
24 #include "wx/window.h"
25 #include "wx/tooltip.h"
27 #include "wx/cocoa/autorelease.h"
28 #include "wx/cocoa/string.h"
30 #import <AppKit/NSView.h>
32 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
36 IMPLEMENT_ABSTRACT_CLASS(wxToolTip, wxObject)
38 wxToolTip::wxToolTip(const wxString &tip) :
39 m_text(tip), m_window(0)
43 wxToolTip::~wxToolTip()
47 void wxToolTip::SetTip(const wxString& tip)
52 const wxString& wxToolTip::GetTip() const
57 // the window we're associated with
58 wxWindow *wxToolTip::GetWindow() const
63 // enable or disable the tooltips globally
65 void wxToolTip::Enable(bool flag)
68 wxFAIL_MSG(wxT("Not implemented"));
71 // set the delay after which the tooltip appears
73 void wxToolTip::SetDelay(long milliseconds)
76 wxFAIL_MSG(wxT("Not implemented"));
79 void wxToolTip::SetWindow(wxWindow* window)
81 wxAutoNSAutoreleasePool pool;
85 //set the tooltip - empty string means remove
87 [m_window->GetNSView() setToolTip:nil];
89 [m_window->GetNSView() setToolTip:wxNSStringWithWxString(m_text)];
92 #endif //wxUSE_TOOLTIPS