]> git.saurik.com Git - wxWidgets.git/commitdiff
wxToolTip
authorRobert Roebling <robert@roebling.de>
Mon, 1 Feb 1999 06:44:35 +0000 (06:44 +0000)
committerRobert Roebling <robert@roebling.de>
Mon, 1 Feb 1999 06:44:35 +0000 (06:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1553 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

14 files changed:
distrib/gtk/copy_src
include/wx/gtk/listbox.h
include/wx/gtk/tooltip.h
include/wx/gtk/window.h
include/wx/gtk1/listbox.h
include/wx/gtk1/tooltip.h
include/wx/gtk1/window.h
samples/controls/controls.cpp
src/gtk/listbox.cpp
src/gtk/tooltip.cpp
src/gtk/window.cpp
src/gtk1/listbox.cpp
src/gtk1/tooltip.cpp
src/gtk1/window.cpp

index c3a0ac772002ece5d7bec65c66f845e6a224c17d..0a532c00c8dcbd203cd3133b63dcc13b5d743a83 100755 (executable)
@@ -3,7 +3,10 @@
 # This script is creates a dir tree in ~/wxgtk_dist which
 # can then be packed into an archive
 
-echo This script will copy the wxGTK release files into ~/wxgtk_dist
+echo                               --------
+echo    This script will copy the wxGTK release files into ~/wxgtk_dist
+echo                               --------
+echo
 
 mkdir ~/wxgtk_dist
 mkdir ~/wxgtk_dist/wxGTK
@@ -668,9 +671,13 @@ cp Makefile ~/wxgtk_dist/wxGTK/samples/wxsocket
 cp Makefile.in ~/wxgtk_dist/wxGTK/samples/wxsocket
 cp *.cpp ~/wxgtk_dist/wxGTK/samples/wxsocket
 cp *.xpm ~/wxgtk_dist/wxGTK/samples/wxsocket
-cd ..
+cd ../..
 
+echo LOCAL CORRECTCIONS
 
+cd distrib/gtk
+cp README.txt ~/wxgtk_dist/wxGTK/utils/wxPython
+cp Setup ~/wxgtk_dist/wxGTK/utils/wxPython/src
 
 
 
index 9d6cafe665c2b46ae0e8bbeb47a9fdc18aa2dc5d..41b5e1b229d3654f7fff582a1c5027e53cc5081d 100644 (file)
@@ -94,9 +94,6 @@ public:
 #if wxUSE_DRAG_AND_DROP
   void SetDropTarget( wxDropTarget *dropTarget );
 #endif
-  void SetToolTip( wxToolTip *tip );
-  void SetToolTip( const wxString &tip );
-
 
 // implementation
     
@@ -105,6 +102,7 @@ public:
   GtkWidget *GetConnectWidget();
   bool IsOwnGtkWindow( GdkWindow *window );
   void ApplyWidgetStyle();
+  void ApplyToolTip( GtkTooltips *tips, const char *tip );
     
   GtkList   *m_list;
   wxList     m_clientDataList;
index a724074f5647f86a07ee20fa01916c0315efe789..299f0945b22ddc60d2b389292726f769e109a208 100644 (file)
@@ -33,23 +33,21 @@ class wxToolTip: public wxObject
 public:
   
     wxToolTip( const wxString &tip );
-    ~wxToolTip();
     
-    wxString GetTip();
+    void SetTip( const wxString &tip );
+    wxString GetTip() const;
+    wxWindow *GetWindow() const;
+    bool Ok() const;
     
-    void Enable( bool flag );
-    void SetDelay( long msecs );
-    bool Ok();
+    static void Enable( bool flag );
+    static void SetDelay( long msecs );
 
   // implementation
     
     wxString     m_text;
+    wxWindow    *m_window;
     
-    GtkTooltips *m_tooltips;
-    GdkColor    *m_bg;
-    GdkColor    *m_fg;
-    
-    void Create( GtkWidget *tool );
+    void Apply( wxWindow *win );
 };
 
 #endif // __GTKTOOLTIPH__
index 0031aa27a1d77d703e3f63fc8065daba9aa601e9..4d8ae64bc54165cdd0ab56b6e4a502896a93ac4f 100644 (file)
@@ -231,16 +231,16 @@ public:
   
   virtual void SetToolTip( const wxString &tip );
   virtual void SetToolTip( wxToolTip *tip );
-  virtual wxToolTip& GetToolTip();
+  virtual wxToolTip* GetToolTip();
 
   virtual void Refresh( bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL );
   virtual void Clear();
 
   virtual wxRegion GetUpdateRegion() const;
-  virtual bool IsExposed(int x, int y) const;
-  virtual bool IsExposed(int x, int y, int w, int h) const;
-  virtual bool IsExposed(const wxPoint& pt) const;
-  virtual bool IsExposed(const wxRect& rect) const;
+  virtual bool IsExposed( int x, int y ) const;
+  virtual bool IsExposed( int x, int y, int w, int h ) const;
+  virtual bool IsExposed( const wxPoint& pt ) const;
+  virtual bool IsExposed( const wxRect& rect ) const;
 
   virtual wxColour GetBackgroundColour() const;
   virtual void SetBackgroundColour( const wxColour &colour );
@@ -320,24 +320,37 @@ public:
 
   // implementation
 
+  virtual wxPoint GetClientAreaOrigin() const;
+  virtual void AdjustForParentClientOrigin( int& x, int& y, int sizeFlags );
+
+  bool HasVMT();
+
+  virtual void OnInternalIdle();
+  
+  /* used by all classes in the widget creation process */
+  
   void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
                     const wxSize &size, long style, const wxString &name );
   void PostCreation();
   
+  /* the methods below are required because many native widgets
+     are composed of several subwidgets and setting a style for
+     the widget means setting it for all subwidgets as well. 
+     also, it is nor clear, which native widget is the top
+     widget where (most of) the input goes. even tooltips have
+     to be applied to all subwidgets. */
+  
   virtual GtkWidget* GetConnectWidget();
   virtual bool IsOwnGtkWindow( GdkWindow *window );
   void ConnectWidget( GtkWidget *widget );
 
-  bool HasVMT();
-
-  virtual wxPoint GetClientAreaOrigin() const;
-  virtual void AdjustForParentClientOrigin( int& x, int& y, int sizeFlags );
-
   GtkStyle *GetWidgetStyle();
   void SetWidgetStyle();
   virtual void ApplyWidgetStyle();
   
-  virtual void OnInternalIdle();
+  virtual void ApplyToolTip( GtkTooltips *tips, const char *tip );
+
+  /* private member variables */
 
   wxWindow            *m_parent;
   wxList               m_children;
index 9d6cafe665c2b46ae0e8bbeb47a9fdc18aa2dc5d..41b5e1b229d3654f7fff582a1c5027e53cc5081d 100644 (file)
@@ -94,9 +94,6 @@ public:
 #if wxUSE_DRAG_AND_DROP
   void SetDropTarget( wxDropTarget *dropTarget );
 #endif
-  void SetToolTip( wxToolTip *tip );
-  void SetToolTip( const wxString &tip );
-
 
 // implementation
     
@@ -105,6 +102,7 @@ public:
   GtkWidget *GetConnectWidget();
   bool IsOwnGtkWindow( GdkWindow *window );
   void ApplyWidgetStyle();
+  void ApplyToolTip( GtkTooltips *tips, const char *tip );
     
   GtkList   *m_list;
   wxList     m_clientDataList;
index a724074f5647f86a07ee20fa01916c0315efe789..299f0945b22ddc60d2b389292726f769e109a208 100644 (file)
@@ -33,23 +33,21 @@ class wxToolTip: public wxObject
 public:
   
     wxToolTip( const wxString &tip );
-    ~wxToolTip();
     
-    wxString GetTip();
+    void SetTip( const wxString &tip );
+    wxString GetTip() const;
+    wxWindow *GetWindow() const;
+    bool Ok() const;
     
-    void Enable( bool flag );
-    void SetDelay( long msecs );
-    bool Ok();
+    static void Enable( bool flag );
+    static void SetDelay( long msecs );
 
   // implementation
     
     wxString     m_text;
+    wxWindow    *m_window;
     
-    GtkTooltips *m_tooltips;
-    GdkColor    *m_bg;
-    GdkColor    *m_fg;
-    
-    void Create( GtkWidget *tool );
+    void Apply( wxWindow *win );
 };
 
 #endif // __GTKTOOLTIPH__
index 0031aa27a1d77d703e3f63fc8065daba9aa601e9..4d8ae64bc54165cdd0ab56b6e4a502896a93ac4f 100644 (file)
@@ -231,16 +231,16 @@ public:
   
   virtual void SetToolTip( const wxString &tip );
   virtual void SetToolTip( wxToolTip *tip );
-  virtual wxToolTip& GetToolTip();
+  virtual wxToolTip* GetToolTip();
 
   virtual void Refresh( bool eraseBackground = TRUE, const wxRect *rect = (const wxRect *) NULL );
   virtual void Clear();
 
   virtual wxRegion GetUpdateRegion() const;
-  virtual bool IsExposed(int x, int y) const;
-  virtual bool IsExposed(int x, int y, int w, int h) const;
-  virtual bool IsExposed(const wxPoint& pt) const;
-  virtual bool IsExposed(const wxRect& rect) const;
+  virtual bool IsExposed( int x, int y ) const;
+  virtual bool IsExposed( int x, int y, int w, int h ) const;
+  virtual bool IsExposed( const wxPoint& pt ) const;
+  virtual bool IsExposed( const wxRect& rect ) const;
 
   virtual wxColour GetBackgroundColour() const;
   virtual void SetBackgroundColour( const wxColour &colour );
@@ -320,24 +320,37 @@ public:
 
   // implementation
 
+  virtual wxPoint GetClientAreaOrigin() const;
+  virtual void AdjustForParentClientOrigin( int& x, int& y, int sizeFlags );
+
+  bool HasVMT();
+
+  virtual void OnInternalIdle();
+  
+  /* used by all classes in the widget creation process */
+  
   void PreCreation( wxWindow *parent, wxWindowID id, const wxPoint &pos,
                     const wxSize &size, long style, const wxString &name );
   void PostCreation();
   
+  /* the methods below are required because many native widgets
+     are composed of several subwidgets and setting a style for
+     the widget means setting it for all subwidgets as well. 
+     also, it is nor clear, which native widget is the top
+     widget where (most of) the input goes. even tooltips have
+     to be applied to all subwidgets. */
+  
   virtual GtkWidget* GetConnectWidget();
   virtual bool IsOwnGtkWindow( GdkWindow *window );
   void ConnectWidget( GtkWidget *widget );
 
-  bool HasVMT();
-
-  virtual wxPoint GetClientAreaOrigin() const;
-  virtual void AdjustForParentClientOrigin( int& x, int& y, int sizeFlags );
-
   GtkStyle *GetWidgetStyle();
   void SetWidgetStyle();
   virtual void ApplyWidgetStyle();
   
-  virtual void OnInternalIdle();
+  virtual void ApplyToolTip( GtkTooltips *tips, const char *tip );
+
+  /* private member variables */
 
   wxWindow            *m_parent;
   wxList               m_children;
index a7965e72da7a3b0379f5bd80b39a32c0fcb06a63..1aef2bffabc1180bbf4ec33b2a07eacb3c706e3b 100644 (file)
@@ -658,6 +658,13 @@ void MyPanel::OnListBoxButtons( wxCommandEvent &event )
     case ID_LISTBOX_ENABLE:
     {
       m_text->WriteText("Checkbox clicked.\n");
+#ifdef __WXGTK__
+      wxCheckBox *cb = (wxCheckBox*)event.GetEventObject();
+      if (event.GetInt())
+        cb->SetToolTip( "Click to enable listbox" );
+      else
+        cb->SetToolTip( "Click to disable listbox" );
+#endif
       m_listbox->Enable( event.GetInt() == 0 );
       break;
     }
index 6d6208d779a3fc4cacde8c2e2f39306e33498e0c..db10f19582989a3ef716c144c2c92dc39cdad354 100644 (file)
@@ -347,7 +347,7 @@ void wxListBox::AppendCommon( const wxString &item )
 #endif
 #endif
 
-    if (m_toolTip) m_toolTip->Create( list_item );
+    if (m_toolTip) m_toolTip->Apply( this );
 }
 
 void wxListBox::Append( const wxString &item )
@@ -676,25 +676,12 @@ int wxListBox::GetIndex( GtkWidget *item ) const
     return -1;
 }
 
-void wxListBox::SetToolTip( const wxString &tip )
+void wxListBox::ApplyToolTip( GtkTooltips *tips, const char *tip )
 {
-    SetToolTip( new wxToolTip( tip ) );
-}
-
-void wxListBox::SetToolTip( wxToolTip *tip )
-{
-    if (m_toolTip) delete m_toolTip;
-    
-    m_toolTip = tip;
-    
-    if (!tip) return;
-    
-    m_toolTip->Create( GTK_WIDGET(m_list) );  /* this has no effect */
-    
     GList *child = m_list->children;
     while (child)
     {
-       m_toolTip->Create( GTK_WIDGET( child->data ) );
+        gtk_tooltips_set_tip( tips, GTK_WIDGET( child->data ), tip, (gchar*) NULL );
         child = child->next;
     }
 }
index f3e3acb598b2273c73bf4a7216971bf333182802..44759110bfc0c378c24c95b2c768984740e40f5d 100644 (file)
 #include "gtk/gtk.h"
 #include "gdk/gdk.h"
 
+//-----------------------------------------------------------------------------
+// global data
+//-----------------------------------------------------------------------------
+
+static GtkTooltips *ss_tooltips = (GtkTooltips*) NULL;
+static GdkColor     ss_bg;
+static GdkColor     ss_fg;
+    
 //-----------------------------------------------------------------------------
 // wxToolTip
 //-----------------------------------------------------------------------------
 wxToolTip::wxToolTip( const wxString &tip )
 {
     m_text = tip;
-    
-    m_tooltips = (GtkTooltips*) NULL;
-    
-    m_fg = new GdkColor;
-    m_fg->red = 0; 
-    m_fg->green = 0;
-    m_fg->blue = 0;
-       
-    m_bg = new GdkColor;
-    m_bg->red = 65535;
-    m_bg->green = 65535;
-    m_bg->blue = 50000;
+    m_window = (wxWindow*) NULL;
 }
 
-wxToolTip::~wxToolTip()
+bool wxToolTip::Ok() const
 {
-    gtk_object_unref( GTK_OBJECT(m_tooltips) );
-    
-    delete m_fg;
-    delete m_bg;
+    return (m_window);
 }
 
-bool wxToolTip::Ok()
+wxString wxToolTip::GetTip() const
 {
-    return (m_tooltips);
+    return m_text;
 }
 
-void wxToolTip::Create( GtkWidget *tool )
+void wxToolTip::SetTip( const wxString &tip )
 {
-    if (!m_tooltips)
+    m_text = tip;
+    Apply( m_window );
+}
+
+void wxToolTip::Apply( wxWindow *win )
+{
+    if (!win) return;
+
+    if (!ss_tooltips)
     {
-        m_tooltips = gtk_tooltips_new();
+        ss_tooltips = gtk_tooltips_new();
+       
+        ss_fg.red = 0; 
+        ss_fg.green = 0;
+        ss_fg.blue = 0;
+        gdk_color_alloc( gtk_widget_get_default_colormap(), &ss_fg );
        
-        gdk_color_alloc( gtk_widget_get_colormap( tool ), m_fg );
-        gdk_color_alloc( gtk_widget_get_colormap( tool ), m_bg );
+        ss_bg.red = 65535;
+        ss_bg.green = 65535;
+        ss_bg.blue = 50000;
+        gdk_color_alloc( gtk_widget_get_default_colormap(), &ss_bg );
        
-       gtk_tooltips_set_colors( m_tooltips, m_bg, m_fg );
+       gtk_tooltips_set_colors( ss_tooltips, &ss_bg, &ss_fg );
     }
     
-    gtk_tooltips_set_tip( m_tooltips, tool, m_text, (gchar*) NULL );
+    m_window = win;
+    
+    if (m_text.IsEmpty())
+        m_window->ApplyToolTip( ss_tooltips, (char*) NULL );
+    else
+        m_window->ApplyToolTip( ss_tooltips, m_text );
 }
 
 void wxToolTip::Enable( bool flag )
 {
-    if (!Ok()) return;
+    if (!ss_tooltips) return;
     
     if (flag)
-        gtk_tooltips_enable( m_tooltips );
+        gtk_tooltips_enable( ss_tooltips );
     else
-        gtk_tooltips_disable( m_tooltips );
+        gtk_tooltips_disable( ss_tooltips );
 }
 
 void wxToolTip::SetDelay( long msecs )
 {
-    if (!Ok()) return;
+    if (!ss_tooltips) return;
     
-    gtk_tooltips_set_delay( m_tooltips, msecs );
+    gtk_tooltips_set_delay( ss_tooltips, msecs );
 }
 
index 9b1cb42717c226fffd6d0466eb5961028f268ce3..69d0c5f2a913b8484e2000d2e8c7d13ec031d5d5 100644 (file)
@@ -2475,24 +2475,44 @@ void wxWindow::Clear()
 
 void wxWindow::SetToolTip( const wxString &tip )
 {
-    SetToolTip( new wxToolTip( tip ) );
+    if (m_toolTip)
+    {
+        m_toolTip->SetTip( tip );
+    }
+    else
+    {
+        m_toolTip = new wxToolTip( tip );
+       m_toolTip->Apply( this );
+    }
+    
+    if (tip.IsEmpty())
+    {
+        delete m_toolTip;
+       m_toolTip = (wxToolTip*) NULL;
+    }
 }
 
 void wxWindow::SetToolTip( wxToolTip *tip )
 {
-    if (m_toolTip) delete m_toolTip;
+    if (m_toolTip)
+    {
+        m_toolTip->SetTip( (char*) NULL );
+        delete m_toolTip;
+    }
     
     m_toolTip = tip;
     
-    if (m_toolTip) m_toolTip->Create( GetConnectWidget() );
+    if (m_toolTip) m_toolTip->Apply( this );
 }
 
-wxToolTip& wxWindow::GetToolTip()
+void wxWindow::ApplyToolTip( GtkTooltips *tips, const char *tip )
 {
-    if (!m_toolTip)
-        wxLogError( "No tooltip set." );
-       
-    return *m_toolTip;
+    gtk_tooltips_set_tip( tips, GetConnectWidget(), tip, (gchar*) NULL );
+}
+
+wxToolTip* wxWindow::GetToolTip()
+{
+    return m_toolTip;
 }
 
 wxColour wxWindow::GetBackgroundColour() const
index 6d6208d779a3fc4cacde8c2e2f39306e33498e0c..db10f19582989a3ef716c144c2c92dc39cdad354 100644 (file)
@@ -347,7 +347,7 @@ void wxListBox::AppendCommon( const wxString &item )
 #endif
 #endif
 
-    if (m_toolTip) m_toolTip->Create( list_item );
+    if (m_toolTip) m_toolTip->Apply( this );
 }
 
 void wxListBox::Append( const wxString &item )
@@ -676,25 +676,12 @@ int wxListBox::GetIndex( GtkWidget *item ) const
     return -1;
 }
 
-void wxListBox::SetToolTip( const wxString &tip )
+void wxListBox::ApplyToolTip( GtkTooltips *tips, const char *tip )
 {
-    SetToolTip( new wxToolTip( tip ) );
-}
-
-void wxListBox::SetToolTip( wxToolTip *tip )
-{
-    if (m_toolTip) delete m_toolTip;
-    
-    m_toolTip = tip;
-    
-    if (!tip) return;
-    
-    m_toolTip->Create( GTK_WIDGET(m_list) );  /* this has no effect */
-    
     GList *child = m_list->children;
     while (child)
     {
-       m_toolTip->Create( GTK_WIDGET( child->data ) );
+        gtk_tooltips_set_tip( tips, GTK_WIDGET( child->data ), tip, (gchar*) NULL );
         child = child->next;
     }
 }
index f3e3acb598b2273c73bf4a7216971bf333182802..44759110bfc0c378c24c95b2c768984740e40f5d 100644 (file)
 #include "gtk/gtk.h"
 #include "gdk/gdk.h"
 
+//-----------------------------------------------------------------------------
+// global data
+//-----------------------------------------------------------------------------
+
+static GtkTooltips *ss_tooltips = (GtkTooltips*) NULL;
+static GdkColor     ss_bg;
+static GdkColor     ss_fg;
+    
 //-----------------------------------------------------------------------------
 // wxToolTip
 //-----------------------------------------------------------------------------
 wxToolTip::wxToolTip( const wxString &tip )
 {
     m_text = tip;
-    
-    m_tooltips = (GtkTooltips*) NULL;
-    
-    m_fg = new GdkColor;
-    m_fg->red = 0; 
-    m_fg->green = 0;
-    m_fg->blue = 0;
-       
-    m_bg = new GdkColor;
-    m_bg->red = 65535;
-    m_bg->green = 65535;
-    m_bg->blue = 50000;
+    m_window = (wxWindow*) NULL;
 }
 
-wxToolTip::~wxToolTip()
+bool wxToolTip::Ok() const
 {
-    gtk_object_unref( GTK_OBJECT(m_tooltips) );
-    
-    delete m_fg;
-    delete m_bg;
+    return (m_window);
 }
 
-bool wxToolTip::Ok()
+wxString wxToolTip::GetTip() const
 {
-    return (m_tooltips);
+    return m_text;
 }
 
-void wxToolTip::Create( GtkWidget *tool )
+void wxToolTip::SetTip( const wxString &tip )
 {
-    if (!m_tooltips)
+    m_text = tip;
+    Apply( m_window );
+}
+
+void wxToolTip::Apply( wxWindow *win )
+{
+    if (!win) return;
+
+    if (!ss_tooltips)
     {
-        m_tooltips = gtk_tooltips_new();
+        ss_tooltips = gtk_tooltips_new();
+       
+        ss_fg.red = 0; 
+        ss_fg.green = 0;
+        ss_fg.blue = 0;
+        gdk_color_alloc( gtk_widget_get_default_colormap(), &ss_fg );
        
-        gdk_color_alloc( gtk_widget_get_colormap( tool ), m_fg );
-        gdk_color_alloc( gtk_widget_get_colormap( tool ), m_bg );
+        ss_bg.red = 65535;
+        ss_bg.green = 65535;
+        ss_bg.blue = 50000;
+        gdk_color_alloc( gtk_widget_get_default_colormap(), &ss_bg );
        
-       gtk_tooltips_set_colors( m_tooltips, m_bg, m_fg );
+       gtk_tooltips_set_colors( ss_tooltips, &ss_bg, &ss_fg );
     }
     
-    gtk_tooltips_set_tip( m_tooltips, tool, m_text, (gchar*) NULL );
+    m_window = win;
+    
+    if (m_text.IsEmpty())
+        m_window->ApplyToolTip( ss_tooltips, (char*) NULL );
+    else
+        m_window->ApplyToolTip( ss_tooltips, m_text );
 }
 
 void wxToolTip::Enable( bool flag )
 {
-    if (!Ok()) return;
+    if (!ss_tooltips) return;
     
     if (flag)
-        gtk_tooltips_enable( m_tooltips );
+        gtk_tooltips_enable( ss_tooltips );
     else
-        gtk_tooltips_disable( m_tooltips );
+        gtk_tooltips_disable( ss_tooltips );
 }
 
 void wxToolTip::SetDelay( long msecs )
 {
-    if (!Ok()) return;
+    if (!ss_tooltips) return;
     
-    gtk_tooltips_set_delay( m_tooltips, msecs );
+    gtk_tooltips_set_delay( ss_tooltips, msecs );
 }
 
index 9b1cb42717c226fffd6d0466eb5961028f268ce3..69d0c5f2a913b8484e2000d2e8c7d13ec031d5d5 100644 (file)
@@ -2475,24 +2475,44 @@ void wxWindow::Clear()
 
 void wxWindow::SetToolTip( const wxString &tip )
 {
-    SetToolTip( new wxToolTip( tip ) );
+    if (m_toolTip)
+    {
+        m_toolTip->SetTip( tip );
+    }
+    else
+    {
+        m_toolTip = new wxToolTip( tip );
+       m_toolTip->Apply( this );
+    }
+    
+    if (tip.IsEmpty())
+    {
+        delete m_toolTip;
+       m_toolTip = (wxToolTip*) NULL;
+    }
 }
 
 void wxWindow::SetToolTip( wxToolTip *tip )
 {
-    if (m_toolTip) delete m_toolTip;
+    if (m_toolTip)
+    {
+        m_toolTip->SetTip( (char*) NULL );
+        delete m_toolTip;
+    }
     
     m_toolTip = tip;
     
-    if (m_toolTip) m_toolTip->Create( GetConnectWidget() );
+    if (m_toolTip) m_toolTip->Apply( this );
 }
 
-wxToolTip& wxWindow::GetToolTip()
+void wxWindow::ApplyToolTip( GtkTooltips *tips, const char *tip )
 {
-    if (!m_toolTip)
-        wxLogError( "No tooltip set." );
-       
-    return *m_toolTip;
+    gtk_tooltips_set_tip( tips, GetConnectWidget(), tip, (gchar*) NULL );
+}
+
+wxToolTip* wxWindow::GetToolTip()
+{
+    return m_toolTip;
 }
 
 wxColour wxWindow::GetBackgroundColour() const