wxWidgets displays everything incorrectly (windows)

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
mariuszp
In need of some credit
In need of some credit
Posts: 7
Joined: Mon Nov 18, 2013 10:58 pm

wxWidgets displays everything incorrectly (windows)

Post by mariuszp »

I'm using MinGW, and have compiled wxWidgets 2.8.12 successfully. However, there was an error while compiling corelib_treectrl.cpp so I just had to add the 2 lines:

Code: Select all

#define NMTVDISPINFOWW NMTVDISPINFOW
#define NMTVDISPINFOAA NMTVDISPINFOA
near the top and it compiled, so I installed it. So I went on to compiling my game engine that uses wxWidgets for its editor. I passed `wx-config --cflags` to g++ and `wx-config --libs' to the linker (also g++). It compiled correctly. However, when I ran it, a lot of things were wrong.

All widgets looked like the old Windows 98 style, instead of the proper theme (including message boxes, etc), the main window did not maximize dispite the request, and all of my dialog boxes drew incorrectly - all the widgets were near the top-left corner of the window, about 8x4 in size. None of these problems occured on Ubuntu.

Can anyone point to what could be causing this? I'm sorry that I don't know what parts of my code are relevant to you.
eranif
Moderator
Moderator
Posts: 610
Joined: Tue Nov 29, 2005 7:10 pm
Location: Israel

Re: wxWidgets displays everything incorrectly (windows)

Post by eranif »

You should have a .rc file in your project and compile it with windres

Create a new file name it resources.rc and put this content into it:

Code: Select all

#include "wx/msw/wx.rc"
1 24 "wx/msw/wx.manifest"
Compile it like this:

Code: Select all

windres -i resources.rc --use-temp-file --define __WXMSW__ --define _UNICODE --include-dir C:/wxWidgets-3.0.0/lib/gcc_dll/mswu --include-dir C:/wxWidgets-3.0.0/include --define WXUSINGDLL    -o resources.rc.o
Ofc, replace these paths "C:/wxWidgets-3.0.0/lib/gcc_dll/mswu" with the actual paths from your machine

when linking your project, make sure you also link against resources.rc.o
Doing this and you will have the "aero" look controls

Eran
IDE: CodeLite + wxCrafter
OS: All
https://wxcrafter.codelite.org
https://codelite.org
Post Reply