win->m_width = alloc->width;
win->m_height = alloc->height;
- win->m_queuedFullRedraw = TRUE;
win->GtkUpdateSize();
}
}
gtk_window_set_title( GTK_WINDOW(m_widget), wxGTK_CONV( title ) );
}
-void wxTopLevelWindowGTK::DoSetIcon( const wxIcon &icon )
-{
- if ( !icon.Ok() )
- return;
-
- if (!m_widget->window)
- return;
-
- wxMask *mask = icon.GetMask();
- GdkBitmap *bm = (GdkBitmap *) NULL;
- if (mask) bm = mask->GetBitmap();
-
- 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;
wxTopLevelWindowBase::SetIcons( icons );
- DoSetIcon( icons.GetIcon( -1 ) );
- if ( window )
+#ifdef __WXGTK20__
+ GList *list = NULL;
+ size_t max = icons.m_icons.GetCount();
+
+ for (size_t i = 0; i < max; i++)
+ {
+ if (icons.m_icons[i].Ok())
+ {
+ list = g_list_prepend(list, icons.m_icons[i].GetPixbuf());
+ }
+ }
+ gtk_window_set_icon_list(GTK_WINDOW(m_widget), list);
+ g_list_free(list);
+
+#else // !__WXGTK20__
+ GdkWindow* window = m_widget->window;
+ if (!window)
+ return;
+
+ wxIcon icon = icons.GetIcon(-1);
+ if (icon.Ok())
{
- wxSetIconsX11( (WXDisplay*)GDK_WINDOW_XDISPLAY( window ),
- (WXWindow)GDK_WINDOW_XWINDOW( window ), icons );
+ wxMask *mask = icon.GetMask();
+ GdkBitmap *bm = (GdkBitmap *) NULL;
+ if (mask) bm = mask->GetBitmap();
+
+ gdk_window_set_icon( m_widget->window, (GdkWindow *) NULL, icon.GetPixmap(), bm );
}
+
+ wxSetIconsX11( (WXDisplay*)GDK_WINDOW_XDISPLAY( window ),
+ (WXWindow)GDK_WINDOW_XWINDOW( window ), icons );
+#endif // !__WXGTK20__
}
// ----------------------------------------------------------------------------
bool wxTopLevelWindowGTK::IsMaximized() const
{
+#ifdef __WXGTK20__
+ if(!m_widget->window)
+ return false;
+
+ return gdk_window_get_state(m_widget->window) & GDK_WINDOW_STATE_MAXIMIZED;
+#else
// wxFAIL_MSG( _T("not implemented") );
// This is an approximation
return FALSE;
+#endif
}
void wxTopLevelWindowGTK::Restore()
{
-#ifdef __GTK20__
+#ifdef __WXGTK20__
// "Present" seems similar enough to "restore"
gtk_window_present( GTK_WINDOW( m_widget ) );
#else
return do_shape_combine_region(window, region);
}
-// vi:sts=4:sw=4:et
+bool wxTopLevelWindowGTK::IsActive()
+{
+#ifdef __WXGTK20__
+ return GTK_WINDOW( m_widget )->has_toplevel_focus;
+#else
+ return wxTopLevelWindowBase::IsActive();
+#endif
+}
+