This repo has been abandoned years ago. As I (original author) commented here, I'm trying this again with now stable and mature language and solid ecosystem in the another repo.
April 1st, 2022.
wxRust
This is a Rust binding for the wxWidgets cross platform toolkit.
API
How it works
The wxRust library is heavily based on the wxHaskell's wxc library.
The wxc is a C language binding for the C++ wxWidgets toolkit.
We utilize the rust-bindgen automatic rust binding generator for its _unsafe low-level binding.
And we generate an OOP-style high-level binding (other modules than _unsafe) by codegen.py code generator.
Build
We use CMake for cross platform build, but Windows platform is not yet tested.
For Linux build instructions, see INSTALL.linux.md
Build Prerequisite
Use following Rust compiler version for your wxRust branch. We're using Servo master's one for main development.
wxRust branch | Supported Rust compiler version |
master | master |
Install the wxWidgets 3.0 (2.9.5 or later is required) and CMake as below (in the case of Homebrew):
brew install wxmac
brew install cmake
With some tweak you may be able to compile wxRust with a bit older versions (2.9.0 < x < 2.9.4) of wxWidgets. See issue #21 comments for details.
Build the library
At the project root directory,
Checkout git submodules:
git submodule init # for the first time.
git submodule update
And generate Makefiles and make:
mkdir build
cd build
cmake ..
make
Compile and Run the Test program
At the CMake binary directory:
make test && ./test
On Mac, Run as below:
make Test.app
open ./Test.app # or open in Finder
Generate Documentation
At the CMake binary directory:
make doc
Generates a rustdoc documentation under doc directory.