A Rust binding of the wxWidgets cross platform toolkit.

Related tags

GUI wxRust
Overview

wxRust

master: master build status / mac(0.10): Mac(0.10) build status

This is a Rust binding for the wxWidgets cross platform toolkit.

API

wxRust API documentation

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 rust-bindgen build status 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.

Comments
  • CMake not working

    CMake not working

    I'm running this on Arch Linux with Rust 0.10.

    $ cmake .. -DwxWidgets_CONFIG_EXECUTABLE=/usr/bin/wx-config
    Re-run cmake no build system arguments
    CMake Warning at CMakeLists.txt:4 (find_package):
      By not providing "Findrustc.cmake" in CMAKE_MODULE_PATH this project has
      asked CMake to find a package configuration file provided by "rustc", but
      CMake did not find one.
    
      Could not find a package configuration file provided by "rustc" with any of
      the following names:
    
        rustcConfig.cmake
        rustc-config.cmake
    
      Add the installation prefix of "rustc" to CMAKE_PREFIX_PATH or set
      "rustc_DIR" to a directory containing one of the above files.  If "rustc"
      provides a separate development package or SDK, be sure it has been
      installed.
    
    
    CMake Warning at CMakeLists.txt:5 (find_package):
      By not providing "Findrustdoc.cmake" in CMAKE_MODULE_PATH this project has
      asked CMake to find a package configuration file provided by "rustdoc", but
      CMake did not find one.
    
      Could not find a package configuration file provided by "rustdoc" with any
      of the following names:
    
        rustdocConfig.cmake
        rustdoc-config.cmake
    
      Add the installation prefix of "rustdoc" to CMAKE_PREFIX_PATH or set
      "rustdoc_DIR" to a directory containing one of the above files.  If
      "rustdoc" provides a separate development package or SDK, be sure it has
      been installed.
    
    
    CMake Error at CMakeLists.txt:6 (include):
      include could not find load file:
    
        Rust
    
    
    CMake Error at CMakeLists.txt:34 (rust_crate):
      Unknown CMake command "rust_crate".
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/gulshan/code/wxRust/build/CMakeFiles/CMakeOutput.log".
    
    bug 
    opened by gsingh93 14
  • SIGSEGV while running test on Linux

    SIGSEGV while running test on Linux

    As I mentioned in #19, although I can finally build wxRust on Linux, test application is crashed by SIGSEGV whenever I push the button. Details are as follows:

    GNU gdb (Gentoo 7.5.1 p2) 7.5.1
    Copyright (C) 2012 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "i686-pc-linux-gnu".
    For bug reporting instructions, please see:
    <http://bugs.gentoo.org/>...
    Reading symbols from ~/wxrust/wxRust/build/test...done.
    (gdb) r
    Starting program: ~/wxrust/wxRust/build/test 
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/libthread_db.so.1".
    22:01:23: Debug: wxColour::Set - couldn't set to colour string 'MEDIUM GREY'
    22:01:23: Debug: wxColour::Set - couldn't set to colour string 'MEDIUM GREY'
    [New Thread 0xaef81b40 (LWP 26715)]
    [New Thread 0xaecffb40 (LWP 26716)]
    hello!
    
    Program received signal SIGSEGV, Segmentation fault.
    0x00000000 in ?? ()
    (gdb) bt
    #0  0x00000000 in ?? ()
    #1  0xb677c867 in wxGetTopLevelParent(wxWindow*) () from /usr/lib/libwx_gtk2u_core-2.9.so.4
    #2  0xb66827a3 in wxDialogBase::GetParentForModalDialog(wxWindow*, long) const () from /usr/lib/libwx_gtk2u_core-2.9.so.4
    #3  0xb660d41e in wxMessageDialog::wxMessageDialog(wxWindow*, wxString const&, wxString const&, long, wxPoint const&) () from /usr/lib/libwx_gtk2u_core-2.9.so.4
    #4  0xb7529b68 in wxMessageDialog_Create () from wxc/libwxc.so
    #5  0x0804c12c in core::wxMessageDialog::new::h5f5c862da2e835a9FAag::v0.0 ()
    #6  0x0804b60c in MyButton::clicked::hddd191c8af96125TJaB::v0.0 ()
    #7  0xb75575bf in wxClosure::Invoke(wxEvent*) () from wxc/libwxc.so
    #8  0xb755770f in wxCallback::Invoke(wxEvent*) () from wxc/libwxc.so
    #9  0xb7557426 in ELJApp::HandleEvent(wxEvent&) () from wxc/libwxc.so
    #10 0xb615f518 in wxAppConsoleBase::HandleEvent(wxEvtHandler*, void (wxEvtHandler::*)(wxEvent&), wxEvent&) const () from /usr/lib/libwx_baseu-2.9.so.4
    #11 0xb615f979 in wxAppConsoleBase::CallEventHandler(wxEvtHandler*, wxEventFunctor&, wxEvent&) const () from /usr/lib/libwx_baseu-2.9.so.4
    #12 0xb62f7536 in wxEvtHandler::ProcessEventIfMatchesId(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) () from /usr/lib/libwx_baseu-2.9.so.4
    #13 0xb62f7944 in wxEvtHandler::SearchDynamicEventTable(wxEvent&) () from /usr/lib/libwx_baseu-2.9.so.4
    #14 0xb62f79fd in wxEvtHandler::TryHereOnly(wxEvent&) () from /usr/lib/libwx_baseu-2.9.so.4
    #15 0xb62f7aa4 in wxEvtHandler::ProcessEventLocally(wxEvent&) () from /usr/lib/libwx_baseu-2.9.so.4
    #16 0xb62f7b05 in wxEvtHandler::ProcessEvent(wxEvent&) () from /usr/lib/libwx_baseu-2.9.so.4
    #17 0xb62f784a in wxEvtHandler::SafelyProcessEvent(wxEvent&) () from /usr/lib/libwx_baseu-2.9.so.4
    #18 0xb6779866 in wxWindowBase::HandleWindowEvent(wxEvent&) const () from /usr/lib/libwx_gtk2u_core-2.9.so.4
    #19 0xb65e853f in ?? () from /usr/lib/libwx_gtk2u_core-2.9.so.4
    #20 0xb5b790d3 in g_cclosure_marshal_VOID__VOIDv () from /usr/lib/libgobject-2.0.so.0
    #21 0xb5b77637 in ?? () from /usr/lib/libgobject-2.0.so.0
    #22 0xb5b90f79 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
    #23 0xb5b91b43 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
    #24 0xb5c3963a in gtk_button_clicked () from /usr/lib/libgtk-x11-2.0.so.0
    #25 0xb5c3aa50 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #26 0xb5b790d3 in g_cclosure_marshal_VOID__VOIDv () from /usr/lib/libgobject-2.0.so.0
    #27 0xb5b75cc7 in ?? () from /usr/lib/libgobject-2.0.so.0
    #28 0xb5b77637 in ?? () from /usr/lib/libgobject-2.0.so.0
    #29 0xb5b90f79 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
    #30 0xb5b91b43 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
    #31 0xb5c3955a in gtk_button_released () from /usr/lib/libgtk-x11-2.0.so.0
    #32 0xb5c395a4 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #33 0xb5cf8b62 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #34 0xb5b7620d in ?? () from /usr/lib/libgobject-2.0.so.0
    #35 0xb5b77394 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
    #36 0xb5b89cd5 in ?? () from /usr/lib/libgobject-2.0.so.0
    #37 0xb5b915b8 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
    #38 0xb5b91b43 in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
    #39 0xb5e311a3 in ?? () from /usr/lib/libgtk-x11-2.0.so.0
    #40 0xb5cf6d0e in gtk_propagate_event () from /usr/lib/libgtk-x11-2.0.so.0
    #41 0xb5cf70a8 in gtk_main_do_event () from /usr/lib/libgtk-x11-2.0.so.0
    #42 0xb437a888 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
    #43 0xb5a84bd6 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
    #44 0xb5a84f75 in ?? () from /usr/lib/libglib-2.0.so.0
    #45 0xb5a8544b in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
    #46 0xb5cf5e3f in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
    #47 0xb657fe27 in wxGUIEventLoop::Run() () from /usr/lib/libwx_gtk2u_core-2.9.so.4
    #48 0xb6163c48 in wxAppConsoleBase::MainLoop() () from /usr/lib/libwx_baseu-2.9.so.4
    ---Type <return> to continue, or q <return> to quit---
    #49 0xb615f412 in wxAppConsoleBase::OnRun() () from /usr/lib/libwx_baseu-2.9.so.4
    #50 0xb664566e in wxAppBase::OnRun() () from /usr/lib/libwx_gtk2u_core-2.9.so.4
    #51 0xb61fbde6 in wxEntry(int&, wchar_t**) () from /usr/lib/libwx_baseu-2.9.so.4
    #52 0xb61fbe86 in wxEntry(int&, char**) () from /usr/lib/libwx_baseu-2.9.so.4
    #53 0xb7541e42 in ELJApp_InitializeC () from wxc/libwxc.so
    #54 0x08049ac0 in core::ELJApp::initializeC::h8bf3fe21ccb59d24XtaN::v0.0 ()
    #55 0x08049885 in start::on_main::haf27ab5ad93909daP::v0.0 ()
    #56 0xb7b1c068 in rt::task::__extensions__::build_start_wrapper::anon::anon::expr_fn::ae ()
       from ~/wxrust/wxRust/build/../../../../usr/local/lib/rustc/i686-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.9-pre.so
    #57 0xb7b1a383 in rt::task::__extensions__::run::anon::expr_fn::ae ()
       from ~/wxrust/wxRust/build/../../../../usr/local/lib/rustc/i686-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.9-pre.so
    #58 0xb7b1c363 in rt::task::Unwinder::try::try_fn::ha074f7dc17d93ad1kjam::v0.9$x2dpre ()
       from ~/wxrust/wxRust/build/../../../../usr/local/lib/rustc/i686-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.9-pre.so
    #59 0xb740c272 in rust_try (f=0xb7b1c330 <rt::task::Unwinder::try::try_fn::ha074f7dc17d93ad1kjam::v0.9$x2dpre>, fptr=0xb7b1a340 <rt::task::__extensions__::run::anon::expr_fn::ae>, 
        env=0xae82d778) at ~/servo/src/compiler/rust/src/rt/rust_builtin.cpp:483
    #60 0xb7b1a0d8 in rt::task::Task::run::h199ab8d6eb226980swab::v0.9$x2dpre ()
       from ~/wxrust/wxRust/build/../../../../usr/local/lib/rustc/i686-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.9-pre.so
    #61 0xb7b1bd09 in rt::task::__extensions__::build_start_wrapper::anon::expr_fn::a5 ()
       from ~/wxrust/wxRust/build/../../../../usr/local/lib/rustc/i686-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.9-pre.so
    #62 0xb7b7c285 in rt::context::Context::new::task_start_wrapper::h1b9fdc38dc3bcfa4B3av::v0.9$x2dpre ()
       from ~/wxrust/wxRust/build/../../../../usr/local/lib/rustc/i686-unknown-linux-gnu/lib/libstd-6c65cf4b443341b1-0.9-pre.so
    #63 0x00000000 in ?? ()
    
    bug 
    opened by newchief 14
  • Can't build on MacOSX with wxWidgets-3.0 @3.0.0_5 from macports

    Can't build on MacOSX with wxWidgets-3.0 @3.0.0_5 from macports

    The error is:

    [ 84%] Building CXX object wxc/CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/taskbaricon.cpp.o [ 85%] Building CXX object wxc/CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/textstream.cpp.o [ 86%] Building CXX object wxc/CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/treectrl.cpp.o [ 86%] Building CXX object wxc/CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/wrapper.cpp.o Linking CXX shared library libwxc.dylib Undefined symbols: "wxWindowBase::IsDescendant(wxWindowBase*) const", referenced from: wxMDIParentFrameBase::TryBefore(wxEvent&) in apppath.cpp.o wxMDIParentFrameBase::TryBefore(wxEvent&) in dragimage.cpp.o wxMDIParentFrameBase::TryBefore(wxEvent&) in eljaccelerator.cpp.o wxMDIParentFrameBase::TryBefore(wxEvent&) in eljartprov.cpp.o wxMDIParentFrameBase::TryBefore(wxEvent&) in eljbitmap.cpp.o wxMDIParentFrameBase::TryBefore(wxEvent&) in eljbrush.cpp.o wxMDIParentFrameBase::TryBefore(wxEvent&) in eljbusyinfo.cpp.o wxMDIParentFrameBase::TryBefore(wxEvent&) in eljbutton.cpp.o wxMDIParentFrameBase::TryBefore(wxEvent&) in eljcalendarctrl.cpp.o wxMDIParentFrameBase::TryBefore(wxEvent&) in eljcaret.cpp.o ...and so on

    with VERBOSE=1: make -f wxc/CMakeFiles/wxc.dir/build.make wxc/CMakeFiles/wxc.dir/depend cd /Users/newchief/wxrust/wxRust/build && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /Users/newchief/wxrust/wxRust /Users/newchief/wxrust/wxRust/wxc /Users/newchief/wxrust/wxRust/ build /Users/newchief/wxrust/wxRust/build/wxc /Users/newchief/wxrust/wxRust/build/wxc/CMakeFiles/wxc.dir/DependInfo.cmake --color= make -f wxc/CMakeFiles/wxc.dir/build.make wxc/CMakeFiles/wxc.dir/build Linking CXX shared library libwxc.dylib cd /Users/newchief/wxrust/wxRust/build/wxc && /opt/local/bin/cmake -E cmake_link_script CMakeFiles/wxc.dir/link.txt --verbose=1 /usr/bin/c++ -I/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/include/wx-3.0 -dynamiclib -Wl,-headerpad_max_install_names -o libwxc.dylib -install_name /Users/ne wchief/wxrust/wxRust/build/wxc/libwxc.dylib CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/apppath.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/dragimage.cpp.o CMakeFiles/wxc.dir//wxHaske ll/wxc/src/cpp/eljaccelerator.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljartprov.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljbitmap.cpp.o CMakeFiles/wxc.dir//wxHaskell/wx c/src/cpp/eljbrush.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljbusyinfo.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljbutton.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/ eljcalendarctrl.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljcaret.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljcheckbox.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljc hecklistbox.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljchoice.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljclipboard.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljcol data.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljcolour.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljcolourdlg.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljcombobox.c pp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljconfigbase.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljcontrol.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljctxhelp.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljcursor.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljdataformat.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljdatetime.cpp.o CMake Files/wxc.dir//wxHaskell/wxc/src/cpp/eljdc.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljdcsvg.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljdialog.cpp.o CMakeFiles/wxc.dir/ /wxHaskell/wxc/src/cpp/eljdirdlg.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljdnd.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljdrawing.cpp.o CMakeFiles/wxc.dir//wxHaskell/wx c/src/cpp/eljevent.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljfiledialog.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljfilehist.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/ cpp/eljfindrepldlg.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljfont.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljfontdata.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/el jfontdlg.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljframe.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljgauge.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljgrid.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljhelpcontroller.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljicnbndl.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljicon.cpp.o CMak eFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljimage.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljimagelist.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljlayoutconstraints.cpp.o CM akeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljlistbox.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljlistctrl.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljlocale.cpp.o CMakeFiles /wxc.dir//wxHaskell/wxc/src/cpp/eljlog.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljmask.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljmdi.cpp.o CMakeFiles/wxc.dir//wxHaske ll/wxc/src/cpp/eljmenu.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljmenubar.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljmessagedialog.cpp.o CMakeFiles/wxc.dir//wxHaskell/wx c/src/cpp/eljmime.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljminiframe.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljnotebook.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cp p/eljpalette.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljpanel.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljpen.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljprintdlg. cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljprinting.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljprocess.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljradiobox.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljradiobutton.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljrc.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljregion.cpp.o CMakeFiles /wxc.dir//wxHaskell/wxc/src/cpp/eljregioniter.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljsash.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljscrollbar.cpp.o CMakeFiles/wxc.d ir//wxHaskell/wxc/src/cpp/eljscrolledwindow.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljsingleinst.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljsizer.cpp.o CMakeFiles/wxc.d ir//wxHaskell/wxc/src/cpp/eljslider.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljspinctrl.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljsplitterwindow.cpp.o CMakeFiles/wxc.di r//wxHaskell/wxc/src/cpp/eljstaticbox.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljstaticline.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljstatictext.cpp.o CMakeFiles/wxc.di r//wxHaskell/wxc/src/cpp/eljstatusbar.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljsystemsettings.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljtextctrl.cpp.o CMakeFiles/wxc. dir//wxHaskell/wxc/src/cpp/eljtimer.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljtipwnd.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljtglbtn.cpp.o CMakeFiles/wxc.dir//wxHas kell/wxc/src/cpp/eljtoolbar.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljvalidator.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/eljwindow.cpp.o CMakeFiles/wxc.dir//wxHaskell/wx c/src/cpp/eljwizard.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/ewxw_main.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/extra.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/glcan vas.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/graphicscontext.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/image.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/managed.cpp.o C MakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/mediactrl.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/previewframe.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/printout.cpp.o CMakeFiles /wxc.dir//wxHaskell/wxc/src/cpp/sckaddr.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/socket.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/sound.cpp.o CMakeFiles/wxc.dir//wxHaskel l/wxc/src/cpp/stc.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/std.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/taskbaricon.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/textstr eam.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/treectrl.cpp.o CMakeFiles/wxc.dir//wxHaskell/wxc/src/cpp/wrapper.cpp.o -L/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wx Widgets/3.0/lib -L/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -f ramework OpenGL -lwx_osx_cocoau_gl-3.0 -lwx_baseu-3.0 -Wl,-rpath,/opt/local/Library/Frameworks/wxWidgets.framework/Versions/wxWidgets/3.0/lib Undefined symbols: "wxWindowBase::IsDescendant(wxWindowBase*) const", referenced from: wxMDIParentFrameBase::TryBefore(wxEvent&) in apppath.cpp.o wxMDIParentFrameBase::TryBefore(wxEvent&) in dragimage.cpp.o wxMDIParentFrameBase::TryBefore(wxEvent&) in eljaccelerator.cpp.o wxMDIParentFrameBase::TryBefore(wxEvent&) in eljartprov.cpp.o

    ... and so on.

    bug 
    opened by newchief 9
  • Can't build on Gentoo Linux with wxWidgets-3.0.0.0 installed from portage

    Can't build on Gentoo Linux with wxWidgets-3.0.0.0 installed from portage

    Although I can build wxRust for MacOSX with wxWidgets-3.0.0 and (with some tweak) for Linux with wxWidgets-2.9.4.1, now after I upgraded wxWidgets on my Linux box to version 3.0.0.0 (present in official Gentoo portage), I'm facing following error:

    [ 92%] Generating wxrust.dummy /root/wxrust/wxRust/src/advanced.rs:16:31: 16:50 error: invoking non-Rust fn in fn without #[fixed_stack_segment], #[deny(cstack)] on by default /root/wxrust/wxRust/src/advanced.rs:16 unsafe { @ELJGridTable(ELJGridTable_Create(_obj, _EifGetNumberRows, _EifGetNumberCols, _EifGetValue, _EifSetValue, _EifIsEmptyCell, _EifClear, ^~~~~~~~~~~~~~~~~~~ /root/wxrust/wxRust/src/advanced.rs:22:25: 22:45 error: invoking non-Rust fn in fn without #[fixed_stack_segment], #[deny(cstack)] on by default /root/wxrust/wxRust/src/advanced.rs:22 unsafe { @wxView(ELJGridTable_GetView(self.handle())) } ^~~~~~~~~~~~~~~~~~~~ /root/wxrust/wxRust/src/advanced.rs:25:17: 25:46 error: invoking non-Rust fn in fn without #[fixed_stack_segment], #[deny(cstack)] on by default /root/wxrust/wxRust/src/advanced.rs:25 unsafe { ELJGridTable_SendTableMessage(self.handle(), id, val1, val2) } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /root/wxrust/wxRust/src/advanced.rs:39:41: 39:70 error: invoking non-Rust fn in fn without #[fixed_stack_segment], #[deny(cstack)] on by default /root/wxrust/wxRust/src/advanced.rs:39 unsafe { @wxCalculateLayoutEvent(wxCalculateLayoutEvent_Create(id)) } ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /root/wxrust/wxRust/src/advanced.rs:45:17: 45:48 error: invoking non-Rust fn in fn without #[fixed_stack_segment], #[deny(cstack)] on by default /root/wxrust/wxRust/src/advanced.rs:45 unsafe { wxCalculateLayoutEvent_GetFlags(self.handle()) }

    ... and so on, tons of lines lihe these ones.

    opened by newchief 7
  • fixes for cargonize branch

    fixes for cargonize branch

    make things work :

    • update dependencies
    • Make build script usable
      • logs
      • updates git submodules
      • doesn't rebuild libwxc.a if already exists
      • exports linker flags for wx widgets (wx-config --libs all)
      • uses recent bindgen as library
      • patches wxHaskell/wxc/src/include/wxc_glue.h (like cmake)
    • fix warnings/errors at compilation time
    • test is run via 'build test' without gui

    tested at OpenSUSE 13.2

    opened by oprudkyi 4
  • Master Rust doesn't allow multiple file input

    Master Rust doesn't allow multiple file input

    Currently the make will fail with master rustc. There are several times where multiple file names are passed to the rustc compiler. Which isn't allow.

    opened by dubcanada 3
  • Travis OS X CI

    Travis OS X CI

    I'm requesting wxmac bottling for this. https://github.com/Homebrew/homebrew/issues/25645

    If above Issue is resolved, we should be able to build on OS X CI environment. see https://github.com/kenz-gelsoft/wxRust/commit/b604661a5d12d41a854767750bf3281d9120224a

    enhancement 
    opened by kenz-gelsoft 3
  • make wxObject params and return values Option<T>.

    make wxObject params and return values Option.

    if it's NULL, we shouldn't call it's method.

    let window = frame.findWindow("Window Name");
    // if window not found, window becomes wxWindow(NULL),
    // you shouldn't call on it, but you can do accidentally...
    let label = window.getLabel(); // BOOOM
    
    enhancement wontfix 
    opened by kenz-gelsoft 3
  • Build for Linux

    Build for Linux

    I had to make some changes in order to be able to build for Linux (Gentoo Linux with wxGTK-2.9.4.1-r1 from distribution):

    1. a symlink ../lib -> /usr/lib as clang's stddef.h need to be found in ../lib/clang/3.3/include during binding generation
    2. _unsafe.rs.patch should not be applied on Linux: diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a8e19e..da4054f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ add_custom_command( --include time.h ${GENSRCS} > src/_unsafe.rs
    • COMMAND patch -p0 < src/_unsafe.rs.patch +# COMMAND patch -p0 < src/_unsafe.rs.patch DEPENDS bindgen.dummy ${GENSRCS} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} )
    1. wxWidgets implementation for Linux is wxGtk not wxMac:

    diff --git a/src/codegen.py b/src/codegen.py index d94e00c..5641ac5 100644 --- a/src/codegen.py +++ b/src/codegen.py @@ -990,7 +990,7 @@ class Preprocessor(object):

     def _call_cpp(self, file):
         cppflags = Popen(['wx-config', '--cppflags'], stdout=PIPE).communicate()[0].split()
    
    •    cppflags.remove('-D__WXMAC__')
      
    •    cppflags.remove('-D__WXGTK__')
       cmdline = ['cpp', '-DWXC_TYPES_H'] + cppflags + ['-I/Users/kenz/src/wxRust/wxHaskell/wxc/src/include', file]
       return Popen(cmdline, stdout=PIPE).communicate()[0]
      
    1. For some reason rust-bindgen was unable to proceed with fail_on_bitfield, therefore I had to patch it too (patch for commit 6b77ae6202cec2204795504b89fa944400245667):

    diff --git a/main.rs b/main.rs index 10522c3..1bb3fea 100644 --- a/main.rs +++ b/main.rs @@ -359,10 +359,10 @@ fn visit_struct(cursor: &Cursor, let bit = cursor.bit_width(); // If we encounter a bitfield, and fail_on_bitfield is set, throw an // error and exit entirely.

    •    if (bit != None && ctx.fail_on_bitfield) {
      
    •        fail!("Cannot handle bitfield `{}` in struct `{}`",
      
    •              name, parent.spelling());
      
    •    }
      
      +// if (bit != None && ctx.fail_on_bitfield) { +// fail!("Cannot handle bitfield {} in struct {}", +// name, parent.spelling()); +// } let field = mk_fieldinfo(name, ty, bit); fields.push(field); }

    Now build completes and I am able to run test. Unfortunately, when I press the button, it segfaults after printing "hello!"

    opened by newchief 2
  • The link to the documentation leads to malware/advertisement sites

    The link to the documentation leads to malware/advertisement sites

    The rust-ci.org domain is now for sale. When I first visited the link, it lead to a beeping page warning about iOS malware that both ublock origin and firefox warned me about. Now it just leads me to the domain sale page.

    opened by IntrepidPig 1
  • Release 0.1 as the last point supporting rust-0.8 compiler.

    Release 0.1 as the last point supporting rust-0.8 compiler.

    As the rust 0.10 was released, I want to drop the rust 0.8 compiler support. I'll tag the last fine revisions for each compilers currently supported, then drop rust 0.8 support.

    opened by kenz-gelsoft 1
  • Is this repo in active development?

    Is this repo in active development?

    Hello,

    Looking over the commit graph there appears to be no history since 2017. I was wondering if we could hand this off to someone to start maintaining or if we should create another repo to start from?

    I don't want to loose all the work on this repo. It is also a little frustrating that WxWidgets wiki links to this repo as a binding and there is no support. GUI options are still a little limited in Rust but making progress.

    I am coming from WxWidgets in C++ and thought this would be a good option to start with seeing as I am familiar with the lib.

    opened by LinuxDevon 2
  • crates.io

    crates.io

    I want to include wxRust in my Cargo.toml but I don't know what to use. I don't even know if wxRust is on crates.io at all. Would you mind publishing it there and adding a note in the repository specifying where it is?

    Thanks!

    opened by LoganDark 0
  • Build problems

    Build problems

    I'm trying to build this, but keep getting an error - if I figure i tout I'll update this and maybe PR the README or whatever's needed - meanwhile here's the problem I have.

    Scanning dependencies of target wxrust [ 87%] Generating ../rust-bindgen/target/debug/bindgen Updating git repository https://github.com/rust-lang/log.git Compiling rust-bindgen v0.13.0 (file:///Users/andrew/workspace/wxRust/rust-bindgen) Running rustc build.rs --crate-name build_script_build --crate-type bin -g --out-dir /Users/andrew/workspace/wxRust/rust-bindgen/target/debug/build/rust-bindgen-be5058dd5296614b --emit=dep-info,link -L dependency=/Users/andrew/workspace/wxRust/rust-bindgen/target/debug -L dependency=/Users/andrew/workspace/wxRust/rust-bindgen/target/debug/deps Compiling log v0.3.6 (https://github.com/rust-lang/log.git#d040d323) Running rustc /Users/andrew/.cargo/git/checkouts/log-c58e1db3de7c154d/master/src/lib.rs --crate-name log --crate-type lib -g --cfg feature=\"use_std\" --cfg feature=\"default\" -C metadata=5439bf31eed317bd -C extra-filename=-5439bf31eed317bd --out-dir /Users/andrew/workspace/wxRust/rust-bindgen/target/debug/deps --emit=dep-info,link -L dependency=/Users/andrew/workspace/wxRust/rust-bindgen/target/debug/deps -L dependency=/Users/andrew/workspace/wxRust/rust-bindgen/target/debug/deps --cap-lints allow build.rs:1:1: 1:22 error: #[feature] may not be used on the stable release channel build.rs:1 #![feature(path_ext)] ^~~~~~~~~~~~~~~~~~~~~ error: aborting due to previous error

    I've tried using rustup, setting 'nightly' as rust version in the wxRust/ folder (parent of 'build/'). Then I get this:

    patching file wxc/src/include/wxc_glue.h Reversed (or previously applied) patch detected! Skipping patch. 4 out of 4 hunks ignored -- saving rejects to file wxc/src/include/wxc_glue.h.rej [ 0%] Built target patch_wxc_glue_h [ 86%] Built target wxc [ 87%] Generating ../rust-bindgen/target/debug/bindgen Compiling rust-bindgen v0.13.0 (file:///Users/andrew/workspace/wxRust/rust-bindgen) Compiling log v0.3.6 (https://github.com/rust-lang/log.git#d040d323) Running rustc build.rs --crate-name build_script_build --crate-type bin -g -C metadata=be5058dd5296614b --out-dir /Users/andrew/workspace/wxRust/rust-bindgen/target/debug/build/rust-bindgen-be5058dd5296614b --emit=dep-info,link -L dependency=/Users/andrew/workspace/wxRust/rust-bindgen/target/debug/deps Running rustc /Users/andrew/.cargo/git/checkouts/log-c58e1db3de7c154d/master/src/lib.rs --crate-name log --crate-type lib -g --cfg feature=\"use_std\" --cfg feature=\"default\" -C metadata=5439bf31eed317bd -C extra-filename=-5439bf31eed317bd --out-dir /Users/andrew/workspace/wxRust/rust-bindgen/target/debug/deps --emit=dep-info,link -L dependency=/Users/andrew/workspace/wxRust/rust-bindgen/target/debug/deps --cap-lints allow error[E0432]: unresolved import std::fs::PathExt --> build.rs:4:5 | 4 | use std::fs::PathExt; | ^^^^^^^^^^^^^^^^ no PathExt in std::fs

    error: aborting due to previous error

    Build failed, waiting for other jobs to finish... error: Could not compile rust-bindgen.

    Caused by: Process didn't exit successfully: rustc build.rs --crate-name build_script_build --crate-type bin -g -C metadata=be5058dd5296614b --out-dir /Users/andrew/workspace/wxRust/rust-bindgen/target/debug/build/rust-bindgen-be5058dd5296614b --emit=dep-info,link -L dependency=/Users/andrew/workspace/wxRust/rust-bindgen/target/debug/deps (exit code: 101) make[2]: *** [../rust-bindgen/target/debug/bindgen] Error 101 make[1]: *** [CMakeFiles/wxrust.dir/all] Error 2 make: *** [all] Error 2

    opened by andrewdavidmackenzie 0
  • SingleInstanceChecker isAnotherRunning failing

    SingleInstanceChecker isAnotherRunning failing

    SingleInstanceChecker::newDefault().isAnotherRunning() always returns a non zero value (looks like a pid), as if another instance of the app is running.

    Some simplified code, to show my use:

    fn main() {
        const NULLPTR: *mut c_void = 0 as *mut c_void;
        let closure = Closure::new(wx_main as *mut c_void, NULLPTR);
        let args: Vec<*mut i32> = Vec::new();
        RustApp::initializeC(&closure, args.len() as i32, args.as_ptr() as *mut *mut i8);
    }
    
    extern "C"
    fn wx_main() {
        let sic = SingleInstanceChecker::newDefault();
        if sic.isAnotherRunning() == 0 {
            println!("Fresh app! 😻");
        } else {
            println!("Another running! {} 😿", sic.isAnotherRunning());
            panic!("Outahere");
        }
        let frame = Frame::new(&Window::null(), ID_ANY, "Hello, wxRust!", -1, -1, -1, -1, DEFAULT_FRAME_STYLE);
        frame.show();
        frame.raise();
    }
    

    Trying the check prior to RustApp init results in /usr/include/wx-3.0/wx/snglinst.h(58): assert "static_cast<wxApp*>(wxApp::GetInstance())" failed in CreateDefault(): must have application instance, so I figure wx_main is the right place for checking.

    For info, the check works fine in the underlying wxHaskell:

    main :: IO ()
    main = do
      start $ singleMintegrator "fileName from elided args handling"
    
    singleMintegrator :: String -> IO ()
    singleMintegrator fileName = do
      sic <- singleInstanceCheckerCreateDefault
      running <- singleInstanceCheckerIsAnotherRunning sic
    
      if running
        then messageMintegrator fileName -- message existing instance
        else mintegrator fileName -- else set up new instance
    
    opened by simon-nicholls 0
Owner
KENZ
KENZ
Cross-platform GUI toolkit written in Rust

Tuix is a cross-platform GUI toolkit written in Rust. The driving principle behind tuix is to be a self-contained, small-as-possible, but still fast,

George Atkinson 166 Dec 13, 2022
A cross-platform GUI toolkit in Rust

NXUI - Native X UI A cross-platform GUI toolkit in Rust NXUI is a GUI toolkit that calls OS native APIs as much as possible to achieve fast operation.

らて 11 Jun 3, 2022
A simple, cross-platform GUI automation module for Rust.

AutoPilot AutoPilot is a Rust port of the Python C extension AutoPy, a simple, cross-platform GUI automation library for Python. For more information,

null 271 Dec 27, 2022
A cross-platform GUI library for Rust, inspired by Elm

Iced A cross-platform GUI library for Rust focused on simplicity and type-safety. Inspired by Elm. Features Simple, easy-to-use, batteries-included AP

Héctor Ramón 17.5k Jan 2, 2023
Truly cross platform, truly native. multiple backend GUI for rust

WIP: Sauron-native a rust UI library that conquers all platforms ranging from desktop to mobile devices. An attempt to create a truly native, truly cr

Jovansonlee Cesar 627 Jan 5, 2023
Cross-platform native Rust menu library

A cross-platform Rust library for managing the native operating system menus.

Mads Marquart 16 Jan 6, 2023
A cross-platform GUI library for Rust focused on simplicity and type-safety

A cross-platform GUI library for Rust, inspired by Elm

Héctor Ramón 17.5k Jan 8, 2023
A cross-platform GUI library for Rust, inspired by Elm

Iced A cross-platform GUI library for Rust focused on simplicity and type-safety. Inspired by Elm. Features Simple, easy-to-use, batteries-included AP

null 17.5k Dec 28, 2022
rsautogui aims to be a cross-platform GUI automation rust crate.

rsautogui rsautogui aims to be a cross-platform GUI automation rust crate. It lets you control the mouse and keyboard to automate interactions with ot

null 5 Sep 18, 2022
Alerion is a cross-platform Rust rewrite of Pterodactyl Wings

alerion ?? A complete rewrite of pterodactyl wings. Caution Here be dragons. This project is still a huge work in progress and is not ready for produc

Pyro 5 Apr 15, 2024
A single-header ANSI C immediate mode cross-platform GUI library

Nuklear This is a minimal-state, immediate-mode graphical user interface toolkit written in ANSI C and licensed under public domain. It was designed a

Immediate Mode UIs, Nuklear, etc. 6.9k Jan 8, 2023
A cross-platform Mod Manager for RimWorld intended to work with macOS, linux and Windows

TODOs are available here. Discussions, PRs and Issues are open for anyone who is willing to contribute. rrm Inspired by Spoons rmm. This is a cross-pl

Alejandro Osornio 7 Sep 5, 2022
A lightweight cross-platform system-monitoring fltk gui application based on sysinfo

Sysinfo-gui A lightweight cross-platform system-monitoring fltk gui application based on sysinfo. The UI design is inspired by stacer. The svg icons a

Mohammed Alyousef 22 Dec 31, 2022
A data-first Rust-native UI design toolkit.

Druid A data-first Rust-native UI toolkit. Druid is an experimental Rust-native UI toolkit. Its main goal is to offer a polished user experience. Ther

null 8.2k Dec 31, 2022
The Rust UI-Toolkit.

The Orbital Widget Toolkit is a cross-platform (G)UI toolkit for building scalable user interfaces with the programming language Rust. It's based on t

Redox OS 3.7k Jan 1, 2023
Rust binding for IUP

IUP Rust This library provides a high level wrapper around IUP, a multi-platform toolkit for building graphical user interfaces. See rust-iup-sys for

David Campbell 41 May 28, 2022
Qt5 binding for rust language. (stalled)

Qt5 binding for Rust language. qt.rs This project provides bindings that allow the QT Gui toolkit to be used from the Rust Programming language. Compi

yatsen1 37 Oct 12, 2021
LightGBM Rust binding

lightgbm-rs LightGBM Rust binding Require You need an environment that can build LightGBM. # linux apt install -y cmake libclang-dev libc++-dev gcc-mu

vaaaaanquish 43 Jan 4, 2023
SixtyFPS is a toolkit to efficiently develop fluid graphical user interfaces for any display: embedded devices and desktop applications. We support multiple programming languages, such as Rust, C++ or JavaScript.

SixtyFPS is a toolkit to efficiently develop fluid graphical user interfaces for any display: embedded devices and desktop applications. We support multiple programming languages, such as Rust, C++ or JavaScript.

SixtyFPS 5.5k Jan 1, 2023