views:

36

answers:

1

Hi

Does anyone know of a cross-platform way to resize a native window - by native i mean one that runs inside of Windows', Mac's or Linux's windowing toolkit?

Any help would be appreciated!

A: 

There isn't one. There's even no cross-platform way to create and show a "native window" by using only standard C++.

There are cross-platform ways by using toolkits/frameworks that provide a platform-independent abstraction of the windowing system, including windows creation, resizing, custom drawing, buttons, etc...:

  • Nokia's Qt: uses native drawing API's for its widgets, meaning everything will look "right", without dealing with platform abnormalities. Has great documentation and a very large featureset.
  • wxWidgets: same as Qt, although some argue documentation is lacking and code can get messy.
  • GTK+: looks ugly on Windows, written in pure c (has C++ wrappers, but is still c).

If you really want to abstract platform stuff yourself, you'll have to either split the source code and reimplement everything the aforementioned projects already have, or use A LOT of #ifdef's like this:

#ifdef _WIN32
    // windows specific code
#elif defined(somelinuxdefine?)
    //Linux code
#elif defined(somemacdefine?)
    // Mac code
#endif

which is at the very least very difficult, messy, and unmaintainable.

rubenvb
Danny Kopping
Nope, sorry, don't have any experience with that.
rubenvb
No worries :) thanks rubenvb!
Danny Kopping