Home

Awesome

KISS-UI Build Status

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.)

Contents

Documentation

kiss-ui docs hosted on Github Pages

Usage

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::*;

KISS-UI builds on all Rust release channels!

Installing IUP Binaries

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

Dynamic linking

  1. Navigate to Windows Libraries/Dynamic
  1. Extract all .dll files to a folder where the linker can find them (pick one):
  1. Copy the same DLLs to a folder in your PATH (pick one):

You should NEVER place arbitrary files in your Windows install folder, no matter how benign.

Static Linking

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.


Linux

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.

Compile from Source

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.

Download the Precompiled Binaries

However, if you would rather download the precompiled binaries, begin by going to the download page.

  1. Navigate to the Linux Libraries folder.
  2. Identify your kernel version. This can be done by entering the command uname -r into a terminal.
  1. Select and download the tarball for your kernel version and bit-arity.
  1. Navigate to the folder where you downloaded the tarball to in a terminal.
  2. Extract the tarball:
  1. Install the binaries:
  1. Follow the prompts in the installer.

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.


OS X

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.


Comparison to Other UI Frameworks

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.

Enabling Visual Styles on Windows

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.