I'm using linux, gcc 4.0.1, wxWidgets 2.6.2 (but from the CVS HEAD of the 2.6 branch)
It looks from the message board that people are using CodeBlocks in Linux or at least have some better success than I've had, any tips or are these new errors in CodeBlocks CVS HEAD?
=================
In src/sdk/projectmanager.cpp the wxImageList is created with
src/sdk/projectmanager.cpp: m_pImages = new wxImageList(16, 16);
however, it tries to load images that are all various sizes. I get a debug assert in wxWidget's wxImageList.
[Debug] 09:50:40 PM: ./src/generic/imaglist.cpp(81): assert "(bitmap.GetWidth() == m_width && bitmap.GetHeight() == m_height) || (m_width == 0 && m_height == 0)" failed: invalid bitmap size in wxImageList: this might work on this platform but definitely won't under Windows.
For example: in void ProjectManager::BuildTree(wxWindow* parent) it tries to load
./src/src/resources/images/folder_open.png is 17x17.
===================
Skip that error and you get
[Debug] 09:57:06 PM: ./src/generic/treectlg.cpp(3547): assert "wxAssertFailure" failed: thawing unfrozen tree control?
Call stack:
...
[11] wxAssert(int, wchar_t const*, int, wchar_t const*, wchar_t const*)
[12] wxGenericTreeCtrl::Thaw()
[13] ProjectManager::UnfreezeTree(bool)
[14] ProjectManager::BuildTree(wxWindow*)
========================
More wrong image sizes for wxImageList
[Debug] 09:58:08 PM: ./src/generic/imaglist.cpp(81): assert "(bitmap.GetWidth() == m_width && bitmap.GetHeight() == m_height) || (m_width == 0 && m_height == 0)" failed: invalid bitmap size in wxImageList: this might work on this platform but definitely won't under Windows.
Call stack:
...
[11] wxAssert(int, wchar_t const*, int, wchar_t const*, wchar_t const*)
[12] wxGenericImageList::Add(wxBitmap const&)
[13] EditorManagerInternalData::BuildTree(wxTreeCtrl*)
[14] EditorManager::BuildOpenedFilesTree(wxWindow*)
======================
[Debug] 09:59:02 PM: ./src/generic/imaglist.cpp(81): assert "(bitmap.GetWidth() == m_width && bitmap.GetHeight() == m_height) || (m_width == 0 && m_height == 0)" failed: invalid bitmap size in wxImageList: this might work on this platform but definitely won't under Windows.
Call stack:
....
[11] wxAssert(int, wchar_t const*, int, wchar_t const*, wchar_t const*)
[12] wxGenericImageList::Add(wxBitmap const&)
[13] MessageManager::SetLogImage(MessageLog*, wxBitmap const&)
[14] EditorManager::CreateSearchLog()
=====================
Then there's some invalid menu items
[Debug] 09:59:37 PM: ./src/common/menucmn.cpp(994): assert "wxAssertFailure" failed: attempt to enable an item which doesn't exist
Call stack:
...
[11] wxAssert(int, wchar_t const*, int, wchar_t const*, wchar_t const*)
[12] wxMenuBarBase::Enable(int, bool)
[13] MainFrame::OnFileMenuUpdateUI(wxUpdateUIEvent&) /home/john/wx/CodeBlocks_CVS/codeblocks/src/src/main.cpp:1922
[14] wxAppConsole::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const
I canceled in the assert dialog since these menu asserts seemed endless.
Note: To avoid asserts for enabling menu items that don't exist you can use FindItem like this:
#define MBAR_ENABLE(menu_id, val) { wxMenuItem *menuItem = mbar->FindItem(menu_id); if (menuItem) { menuItem->Enable(val); } }
src/src/main.cpp
void MainFrame::OnFileMenuUpdateUI(wxUpdateUIEvent& event)
{
...
bool canCloseProject = (ProjectManager::CanShutdown() && EditorManager::CanShutdown());
MBAR_ENABLE(idProjectCloseProject,canCloseProject);
...
}
"Fix" (or at least hide the problem) in this file as well
src/plugins/compilergcc/compilergcc.cpp
void CompilerGCC::OnUpdateUI(wxUpdateUIEvent& event)
Also... though this is a personal preference, using UpdateUI events for enabling menu/toolbar items is often massive overkill. For example UpdateUI events are sent for toolbar tools between just about every event, even just moving the mouse sends them. Using ui events are convenient, but they can tend to make programs a little sluggish.
The GUI for CodeBlocks shows at this point, but there are tons more errors.
Thanks for any tips, I can provide patches for some of these, but if the developers have access to a Linux box, most of these errors seem trivial and can be very quickly fixed.
Regards,
John Labenski