Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
wxDragon - Cross-Platform Native GUI for Rust
wxDragon brings the power of wxWidgets to Rust, enabling you to build beautiful, native desktop applications that run seamlessly across Windows, macOS, and Linux. With wxDragon, your applications will look and feel native on every platform while maintaining a single Rust codebase.
Why Choose wxDragon?
🎯 Native Look & Feel - Your apps integrate perfectly with each operating system's design language
🚀 Single Codebase - Write once, run everywhere with true cross-platform compatibility
🛡️ Memory Safe - All the safety guarantees of Rust with the mature wxWidgets foundation
⚡ High Performance - Direct access to native GUI components with minimal overhead
🎨 Rich Widget Set - Comprehensive collection of native controls and layouts
🔧 Two Development Styles - Choose between programmatic creation or visual XRC design
Screenshots


Quick Start
Add wxDragon to your Cargo.toml:
[]
= "*"
Simple Example
use *;
Visual UI Design with XRC
For complex interfaces, wxDragon supports XRC (XML Resource) files with compile-time type safety. Design your UI visually with tools like wxFormBuilder, then load it seamlessly into Rust.
1. Design your UI (ui/main.xrc):
wxDragon XRC Demo
400,300
Click Me!
50,50
Enter text here...
50,100
200,25
Ready
50,150
2. Use the include_xrc! macro for type-safe UI:
use *;
// Generate typed UI struct from XRC file
include_xrc!;
Benefits of XRC approach:
- Visual Design - Use GUI designers for rapid prototyping
- Type Safety - Compile-time checking of widget names and types
- Clean Separation - UI layout separate from application logic
- Professional Workflows - Integrate with existing design tools
Platform Support
| Platform | Status | Notes |
|---|---|---|
| Windows | ✅ Full Support | Native Win32 controls |
| macOS | ✅ Full Support | Native Cocoa integration |
| Linux | ✅ Full Support | GTK+ backend |
Cross-compilation is supported, including building Windows executables from macOS.
Installation & Setup
Prerequisites
All Platforms:
- Rust (latest stable)
- CMake
- C++ compiler
Linux Additional Requirements:
# Ubuntu/Debian
# Fedora/RHEL
Windows Additional Requirements:
- Visual Studio Build Tools or Visual Studio with C++ support
- Windows SDK
- Ninja build system:
winget install --id=Ninja-build.Ninja -e - [REQUIRED for MinGW builds] WinLibs GCC 15.1.0 UCRT toolchain (must match the version used for prebuilt wxWidgets libraries)
⚠️ Important: You must use the exact same MinGW/WinLibs GCC version as the prebuilt wxWidgets libraries (GCC 15.1.0 UCRT, WinLibs) for MinGW builds. Mismatched toolchains will cause linker errors for C++ symbols. Download from: https://github.com/brechtsanders/winlibs_mingw/releases/tag/15.1.0posix-13.0.0-ucrt-r2
Install WinLibs GCC 15.1.0 UCRT (for MinGW builds):
- Download the release from WinLibs GCC 15.1.0 UCRT
- Extract to
C:\mingw64(or another directory) - Add
C:\mingw64\mingw64\binto yourPATH - Set the Rust linker:
Note: When building on Windows with MinGW/WinLibs, always use a regular Windows shell (such as
cmd.exeor PowerShell), not an MSYS2 shell. Using MSYS2 may cause your build to use the wrong GCC toolchain, resulting in linker errors due to ABI mismatches.The wxDragon CI is configured to use WinLibs GCC 15.1.0 UCRT in a Windows shell for all Windows GNU builds, ensuring ABI compatibility with the prebuilt wxWidgets libraries.
Building with MSVC on Windows
Prerequisites:
- Visual Studio 2019 or later (Community/Professional/Build Tools)
- Windows 10 or 11 SDK
- CMake
Instructions:
- Open a "x64 Native Tools Command Prompt for VS 2019/2022" (or use the Developer PowerShell)
- Ensure
cl.exeandcmake.exeare in yourPATH - Build your project:
MSVC builds do not require the WinLibs toolchain. wxDragon will automatically use the correct prebuilt wxWidgets libraries for MSVC.
Building Your Project
# Clone and build
# Add wxdragon to Cargo.toml
# Build (pre-built wxWidgets libraries will be downloaded automatically)
# Run
wxDragon automatically downloads pre-built wxWidgets libraries during the first compilation, reducing build times from 20+ minutes to under 3 minutes. No manual wxWidgets installation required!
Windows OS Theme Integration
To enable native Windows theming and modern OS integration features (such as dark mode support, high-DPI awareness, and crisp visual styling), add a build.rs file to your project root:
Create build.rs:
use ;
use ;
Add the dependency to Cargo.toml:
[]
= "1.4"
What this enables:
- ✅ Modern Theming - Windows Common Controls v6 for native Windows 10/11 styling
- ✅ Dark Mode Support - Automatic dark mode integration when system uses dark theme
- ✅ High-DPI Awareness - Crisp rendering on high-resolution displays (Per-Monitor V2)
- ✅ UTF-8 Support - Better Unicode handling for international applications
- ✅ Performance Optimizations - Segment heap for improved memory management
- ✅ Long Path Support - Support for Windows long file paths when enabled
- ✅ Cross-Compilation Compatible - Works when building Windows apps from macOS/Linux
Note: The manifest embedding works seamlessly with both native Windows builds (MSVC/MinGW) and cross-compilation from other platforms. Your application will automatically integrate with Windows theme changes and display properly on modern Windows systems.
Without this manifest, your wxDragon application will still work but may appear with older Windows styling and lack some modern OS integration features.
Cross-Compilation (macOS → Windows)
⚠️ Important: For cross-compilation, you must use the same WinLibs GCC version as the prebuilt wxWidgets libraries. Install it via Homebrew or download the matching version manually if needed.
# Install MinGW-w64 toolchain (Homebrew may not always match the required version)
# Or download and use WinLibs GCC 15.1.0 UCRT manually for ABI compatibility
# Add Windows target
# Build for Windows
If you encounter linker errors for C++ symbols, double-check that your MinGW/WinLibs GCC version matches the prebuilt wxWidgets libraries exactly.
Rich Widget Ecosystem
wxDragon provides comprehensive widget support including:
- Basic Controls - Buttons, text fields, checkboxes, sliders, progress bars
- Advanced Input - Date pickers, color pickers, rich text editors, search controls
- Data Display - Lists, trees, tables, data views with sorting and filtering
- Layout Management - Flexible sizers, notebooks, splitters, scrollable containers
- Menus & Toolbars - Full menu system with accelerators and toolbar support
- Dialogs - File choosers, message boxes, custom dialogs
- Media & Graphics - Image display, animations, media playback, drawing contexts
Examples
Explore the examples/ directory for comprehensive demonstrations:
- Simple - Basic window and controls
- Gallery - Showcase of all available widgets
- Custom Widgets - Creating your own controls
- Media Player - Audio/video playback application
- Data Views - Complex data display and editing
# Run the gallery to see all widgets in action
Getting Help
- Documentation - API Documentation
- Examples - Browse the
examples/directory - Issues - GitHub Issues
License
wxDragon is dual-licensed under Apache 2.0 and MIT licenses, giving you flexibility in how you use it in your projects.