A UI framework for Rust based on the KISS (Keep It Simple, Stupid!) philosophy.
Powered by the IUP GUI library for C by Tecgraf, via the bindings created for iup-rust.
(No relation to the equally awesome kiss3d.)
kiss-ui
docs hosted on Github Pages
Simply add the following to your Cargo.toml
:
[dependencies.kiss-ui]
git = "https://github.com/cybergeek94/kiss-ui"
Import KISS-UI's macros and common types:
#[macro_use]
extern crate kiss_ui;
use kiss_ui::prelude::*;
You will need to install the IUP binaries for your system, which are available for download here.
Consult the following for which files to download and where to install them. The specific steps depend on your platform and preferred method of linking: dynamic or static.
PRs amending or adding instructions for any platform are very welcome.
Windows Libraries/Dynamic
iup-3.14_Win32_dllw4_lib.zip
iup-3.14_Win64_dllw4_lib.zip
.dll
files to a folder where the linker can find them (pick one):
<Rust install>/bin/rustlib/<platform target>/lib/
(recommended)<MinGW/MSYS install>/usr/lib
<Your cargo repository>/bin/<platform target>
<Rust install>/bin/
(recommended)You should NEVER place arbitrary files in your Windows install folder, no matter how benign.
Static linking with IUP on Windows is not currently possible as it requires resource scripts (.rc
) files from IUP to be compiled and linked in, which Rust does not currently support.
The Linux binary packages for IUP include both static and dynamic libraries. While efforts are underway to create up-to-date packages for various distributions' package managers, the currently most well supported methods of obtaining IUP binaries are to either compile them from source or download precompiled binaries from the creators.
To compile from source, see this page. The instructions to check-out the source tree are available here. If you understand how to build projects with Makefiles, then it shouldn't be too difficult.
However, if you would rather download the precompiled binaries, begin by going to the download page.
Linux Libraries
folder.uname -r
into a terminal.
uname -a
and look for the following:x86_64
: Your system is 64-bit.x86
: Your system is 32-bit.x86
), there is only one package: iup-3.14_Linux32_lib.tar.gz
x86_64
), select one of the following based on your kernel version:iup-3.14_Linux319_64_lib.tar.gz
iup-3.14_Linux313_64_lib.tar.gz
iup-3.14_Linux35_64_lib.tar.gz
iup-3.14_Linux32_64_lib.tar.gz
iup-3.14_Linux26g4_64_lib.tar.gz
mkdir iup_libs/
tar -xzvf <tarball file> -C iup_libs/
cd iup_libs/
(The install script must be run in its folder.)sudo ./install
sudo ./install_dev
Once the installer completes, you are finished. If you later want to uninstall IUP, open that iup_libs/
folder in a terminal and run sudo ./uninstall
. Otherwise, you may now delete the tarball and/or the iup_libs/
folder.
Before you install IUP, you need to install GTK+. (An IUP driver for Cocoa was under development, but as of 7/5/2015 is not being worked on.) You can use version 2.x or 3.x, IUP will work with both.
To install GTK+ 2:
brew install gtk+
To install GTK+ 3:
brew install gtk+3
Note: if you have troubles building after installing GTK+ 3, please consult this StackOverflow answer.
Once GTK+ is installed, you can download and install the precompiled Mac OS X IUP binary available here. It appears the only download available is for OS X 10.10 64-bit.
Once you have downloaded the tarball, the installation process should be equivalent to Linux's starting at Step 4.
NOTE: This list is far from exhaustive and may contain outdated information.
Pull requests for corrections and additions are welcome!
Lines of code should be listed based on the # sloc
stat on the Github file page. The raw linecount includes empty lines, which can arbitrarily affect the linecount.
Since Rust/Cargo currently do not support adding resource items to executables, Windows XP and later need an external manifest file to enable visual styles in KISS-UI applications. Otherwise the visual style will be Windows Classic.
However, we have made this very simple to do! Simply copy the kiss-app.manifest
file from this repo into the folder of your KISS-UI based executable, rename the file to <executable name>.manifest
(including the .exe
extension, e.g. my_executable.exe.manifest
), and run the executable as-is. You may need to delete and replace or rebuild the executable for this to take effect, as Windows appears to cache manifest file data, likely to avoid reparsing it on each run.
Optionally, you can edit the name=
and the <description>
values in the manifest file, using any text editor. However, it is unclear to the author what these actually affect.