wxWidgets标题栏图标 [英] wxWidgets Title bar icon
问题描述
我想更改显示在框架左上角的默认图标.我尝试了许多方法-xpm,ico,bmp,按照建议SetIcon(wxIcon(wxT("icon.xpm"))); >这里.
我尝试了不同的图标尺寸,分别为16x16、24x24和32x32.
我还尝试在resource.rc文件中添加 MYICON1 ICON"Logo.ico"
,在resource.h文件中添加 #define MYICON1 101
和 SetIcon(wxIcon(MYICON1));
到框架构造函数..
顺便说一句,我正在Visual Studio 2010上使用wxwidgets 2.8
I want to change the default icon that shows up at the top left corner of the frame.
I have tried many approaches- xpm, ico, bmp,
using SetIcon(wxIcon(wxT("icon.xpm")));
as suggested here.
I tried different icon sizes, 16x16, 24x24 and 32x32.
I've also tried adding MYICON1 ICON "Logo.ico"
in the resource.rc file, #define MYICON1 101
in the resource.h file and SetIcon(wxIcon(MYICON1));
to the frame constructor..
btw, i'm using wxwidgets 2.8 on visual studio 2010
我还尝试在resource.rc文件中添加
MYICON1 ICON"Logo.ico"
,在resource.h文件中添加#define MYICON1 101
和SetIcon(wxIcon(MYICON1));
到框架构造函数.
I've also tried adding
MYICON1 ICON "Logo.ico"
in the resource.rc file,#define MYICON1 101
in the resource.h file andSetIcon(wxIcon(MYICON1));
to the frame constructor..
使用这种方法,在wxIcon(int)构造函数中出现错误.
With this approach, I get an error in the wxIcon(int) constructor..
1> xsframe.cpp(17):错误C2248:'wxString :: wxString':无法访问在类'wxString'中声明的私有成员
1> C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ VC \ include \ wx/string.h(682):请参见'wxString :: wxString'的声明
1> C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ VC \ include \ wx/string.h(659):请参见'wxString'的声明
1>xsframe.cpp(17): error C2248: 'wxString::wxString' : cannot access private member declared in class 'wxString'
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wx/string.h(682) : see declaration of 'wxString::wxString'
1> C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\wx/string.h(659) : see declaration of 'wxString'
PS,xsframe是我的主框架.我正在尝试更改其图标.
PS, xsframe is my main frame. whose icon i'm trying to change.