Skip to content

WxWidgets

wxWidgets Classes

wxWidgets (이전 이름: wxWindows)는 크로스 플랫폼 응용 프로그램을 위한 그래픽 사용자 인터페이스를 만들어 주는 위젯 툴킷이다. wxWidgets는 특별한 코드 변경 없이도 프로그램의 GUI 코드를 여러 컴퓨터의 운영 체제에서 컴파일하고 동작할 수 있게 도와 준다. 마이크로소프트 윈도, 맥 오에스 텐, 리눅스/유닉스 (X11, 모티프, GTK+), 오픈VMS, OS/2, 아미가OS와 같은 운영 체제를 지원한다.

How to compile

설치경로에서 /build/msw로 이동한 후 아래와 같이 컴파일 한다.

mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=debug

릴리즈 모드는 아래와 같이 입력하면 된다.

mingw32-make -f makefile.gcc MONOLITHIC=1 SHARED=1 UNICODE=1 BUILD=release

참고로 컴파일된 라이브러리를 사용할 경우 -std=c++11플래그를 적용하면 정상적으로 작동하지 않을 경우가 있다.1 이 경우 -std=gnu++11를 사용하면 된다.

MinGW build

mingw32-make.exe를 사용하여 설치한다. libiconv-2.dll파일과 관련된 에러가 발생할 경우 mingw가 설치되 디렉토리의 bin/libiconv-2.dll파일을 복사하면 된다. 사용되는 mingw32-make의 버전은 3.82이다.

Makefile parameter:

  • SHARED=0: Builds static libraries.
  • SHARED=1: Builds dynamic libraries.
  • MONOLITHIC=1: Packages all libraries in a single file. (Note: do not combine this option with a static build.)
  • UNICODE=1: Builds wxWidgets with Unicode support.
  • BUILD=debug: Build the library with debug support.
  • BUILD=release: Release build of the library (with no debug support).

빌드 방법:

  • 동적 라이브러리(DLL)작성. (단일파일)
    • mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=release
    • mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=debug
  • 동적 라이브러리(DLL)작성. (다중파일)
    • mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release
    • mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=debug
  • 정적 라이브러리작성. (다중파일)
    • mingw32-make -f makefile.gcc SHARED=0 UNICODE=1 BUILD=release
    • mingw32-make -f makefile.gcc SHARED=0 UNICODE=1 BUILD=debug

Simple build:

cd /d [wsWidgets설치디렉토리]\build\msw
mingw32-make -f makefile.gcc SHARED=1 MONOLITHIC=1 UNICODE=1 BUILD=release

MacOSX compile

build-release폴더로 이동한 뒤 아래와 같이 configure명령을 실행한다.

$ ../configure --with-osx_cocoa --with-macosx-version-min=10.8 \
    --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk \
    --enable-unicode --enable-monolithic --prefix="$(pwd)"
  • --with-osx_cocoa: Cocoa 프레임워크를 이용함. 64비트를 지원. Lion/Mountain Lion 사용자는 설정
  • --enable-universal_binary: 32비트, 64비트를 모두 지원. 완성될 어플리케이션의 타겟 사용자가 Lion/Mountain Lion에 국한된다면 설정하지 않는 것을 추천
  • --with-macosx-version-min=10.8: 뒤에 10.8을 바꿈으로써 최소 지원 OSX 버전을 결정
  • --with-macosx-sdk=path: 역시 뒤에 10.8을 바꿈으로써 사용할 SDK 버전을 결정. --with-macosx-version-min과 통일할 것을 추천
  • --enable-unicode: 유니코드를 사용할 것인지 여부
  • --enable-monolithic: 빌드 결과물을 하나의 단일 라이브러리로 할 것인지 여부. 세부적인 설정이 귀찮다면 활성화 하기를 추천
  • --disable-shared: 빌드 결과물을 dynamic library가 아닌 static library로 할 지 여부. --enable-monolithic과 함께 활성화 할 수 없으니 주의.

디버깅 모드로 빌드하고 싶다면 --enable-debug옵션을 추가하면 된다.

Libraries

WxWidgets_library_diagram.png

wxWidgets class Hierarchy

WxWidgets-Class_hierarchy.png

Category

Example

Local Download

wxWidgets 3.1.0
WxWidgets-3.1.0.tar.gz (Github source code)
Cross-Platform GUI Programming with wxWidgets
https://ptgmedia.pearsoncmg.com/images/0131473816/downloads/0131473816_book.pdf
Cross-Platform_GUI_Programming_with_wxWidgets_-_0131473816_book.pdf

See also

GUI Form Editor

Web

Favorite site

Tutorial

Guide

References


  1. 3.0.2 버전에서 확인됨. 관련 내용은 이곳에서 확인 가능. 

  2. Zetcode.com-170124.zip 

  3. WxWidgets-2.8.12-HTML.zip 

  4. Introduction_to_wxWidgets_-_CodeProject.pdf 

  5. CODEpendent-wx-sdl_tutorial_part_1.pdf 

  6. Wx-sdl_src.zip 

  7. WxWiki_-_Precompiled_Headers.pdf