]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/toplevel.cpp
Committing in .
[wxWidgets.git] / src / gtk1 / toplevel.cpp
index dbe2a3a928a2ffbae0245a44e33f2b28da7980ff..6484fa7f0090a0df223237b5ec2a98600be66ca5 100644 (file)
@@ -38,6 +38,8 @@
 
 #include "wx/gtk/win_gtk.h"
 
 
 #include "wx/gtk/win_gtk.h"
 
+#include "wx/unix/utilsx11.h"
+
 // ----------------------------------------------------------------------------
 // idle system
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // idle system
 // ----------------------------------------------------------------------------
@@ -814,13 +816,9 @@ void wxTopLevelWindowGTK::SetTitle( const wxString &title )
     gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() );
 }
 
     gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() );
 }
 
-void wxTopLevelWindowGTK::SetIcon( const wxIcon &icon )
+void wxTopLevelWindowGTK::DoSetIcon( const wxIcon &icon )
 {
 {
-    wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
-
-    wxTopLevelWindowBase::SetIcon(icon);
-
-    if ( !m_icon.Ok() )
+    if ( !icon.Ok() )
         return;
 
     if (!m_widget->window)
         return;
 
     if (!m_widget->window)
@@ -833,6 +831,24 @@ void wxTopLevelWindowGTK::SetIcon( const wxIcon &icon )
     gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
 }
 
     gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
 }
 
+void wxTopLevelWindowGTK::SetIcon( const wxIcon &icon )
+{
+    SetIcons( wxIconBundle( icon ) );
+}
+
+void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons )
+{
+    wxASSERT_MSG( (m_widget != NULL), wxT("invalid frame") );
+    GdkWindow* window = m_widget->window;
+    wxCHECK_RET( window, _T("window not created yet - can't set icon") );
+
+    wxTopLevelWindowBase::SetIcons( icons );
+
+    DoSetIcon( icons.GetIcon( -1 ) );
+    wxSetIconsX11( (WXDisplay*)GDK_WINDOW_XDISPLAY( window ),
+                   (WXWindow)GDK_WINDOW_XWINDOW( window ), icons );
+}
+
 // ----------------------------------------------------------------------------
 // frame state: maximized/iconized/normal
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // frame state: maximized/iconized/normal
 // ----------------------------------------------------------------------------