lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lmi] Skeleton::InitIcon() cleanup


From: Vaclav Slavik
Subject: Re: [lmi] Skeleton::InitIcon() cleanup
Date: Sat, 28 Mar 2009 21:18:05 +0100

On Thu, 2008-08-07 at 22:57 +0200, Vadim Zeitlin wrote:
> multi-megabyte file are worth the ability to refer to the icon in the
> code by its real name, thus avoid #ifdefs.

Unfortunately, this doesn't do the right thing on Unix, where SetIcons()
needs to be used to set the icons in multiple resolutions. I propose to
apply this patch instead:

--- main_wx.cpp 2009-03-26 16:47:29 +0000
+++ main_wx.cpp 2009-03-28 19:58:14 +0000
@@ -441,20 +441,7 @@
 
 void Skeleton::InitIcon()
 {
-#ifdef LMI_MSW
-    // If a wxIcon rather than a wxIconBundle were used here, then
-    // lossy shrinkage of a large icon could occur on msw; this
-    // approach uses a smaller icon in the '.ico' file instead.
-    //
-    // WX !! However, this method:
-//    frame_->SetIcons(wxIconBundle("mondrian.ico", wxBITMAP_TYPE_ICO));
-    // displays a black-and-white icon in the alt-tab task switcher
-    // on msw, even though the 256-color 32x32 icon comes first in the
-    // '.ico' file; but this shows the color icon:
-    frame_->SetIcons(wxICON(AAAAAAAA));
-#else // Not defined LMI_MSW.
-    frame_->SetIcon(wxIcon(AddDataDir("lmi.png")));
-#endif // Not defined LMI_MSW.
+    frame_->SetIcons(wxIconBundle(AddDataDir("lmi.ico")));
 }
 
 void Skeleton::InitMenuBar()


This requires lmi.ico to exist as a file, but it avoids #ifdefs;
alternatively, this could be done in !LMI_MSW case only.

Vaclav





reply via email to

[Prev in Thread] Current Thread [Next in Thread]