PistonDevelopers/conrod — pull request #31 by mitchmindtree (2014-08-08 07:43:39+00:00)
Title: Initial commit of early Widget trait with example. Includes Button, Toggle and Slider.

Conrod has been lying dormant for a while now, so I thought I'd try and kick it off a little by starting to lay down some of the `Widget` framework. The `Widget` system currently works with a node-like structure, where each `Widget` can be made of a series of other child `Widget`s. I've implemented three basic `Widget`s to demonstrate this implementation - `Button`, `Toggle` and `Slider`. I've added an example where you can play with these and check out their aesthetics, however none of them are plugged into anything yet so don't expect anything too exciting when you move the slider / flick the toggle.

The next major TO-DOs that come to mind are:
1. Creating a `Listener` system, where a user can define `Listener` methods that will get called each time a `Widget` has been interacted with.
2. Labels / Text / Font . I'm not sure how best to approach this or what the general plans are for Piston in this area. I had a go at using the freetype-rs example a day or two ago, however it currently segfaults upon close. I'm unsure if there are plans to fix this or if there are other plans for implementing a more general unicode for example?

Bugs:
- The `RelativePosition` enum doesn't work quite as expected in some cases but I'll have a closer look tonight and see if I can fix it.

This approach to a widget system is quite an imperative approach though also hopefully familiar. I'm totally open to suggestions and critique - the main thing I hope to achieve with this PR is to get some movement happening on conrod and Piston UI in general :-)