[dev] SWK: The simple widget kit

From: <pancake_AT_youterm.com>
Date: Sat, 8 May 2010 09:00:02 -0400 (EDT)

Anselm and me have been talking to get a proper initial design
to bring a minimalistic widget toolkit to the masses.

After few months of thinking, typing test programs and so on
I have managed to get a working state for the project, so I'm
exposing the results of this work in this mail looking for
people who is interested on helping to the project with ideas,
patches and so on.

SWK is a comprehensive widget kit that aims to be simple,
lightweight and support many graphical backends (SDL, x11..)

At the moment I have focused the development on SDL, and I have
managed to use it in desktop, n900 and a dingoo console. But
there's still bugs to fix, things to optimize, missing features
and other stuff that is not yet done..but described in TODO.

The current set of widgets:

        void swk_button(SwkEvent *e);
        void swk_label(SwkEvent *e);
        void swk_entry(SwkEvent *e);
        void swk_password(SwkEvent *e);
        void swk_filler(SwkEvent *e);
        void swk_option(SwkEvent *e);
        void swk_separator(SwkEvent *e);
        void swk_progress(SwkEvent *e);
        void swk_image(SwkEvent *e);
        void swk_sketch(SwkEvent *e);

Text processing is pretty basic, no formatting, no cursor support, etc..
The creation of new widgets is as simple as defining such a event
handler function and embed it into an array of SwkBox'es to the
SwkWindow in use.

Some of the basics of the design are:

 - 1 window per-app
 - automatic scrolling area, so no hidden elements
 - clean/separated graphical API
 - no trees, just plain 1 dimensional array of widgets
 - rows are defined by NEWLINE elements
 - automatic alignment based of minimum values and swk layout
 - <2KLOC :) (now is 800LOC)

I would explain so many things more about the library, but I
think is better if you give a look at the source and try the

Feel free to give me feedback and dont be shy to send patches.

To build the current version you need:

  sdl, sdl-ttf and sdl-image

Try it and let me know what do you think about it

  hg clone http://hg.suckless.org/swk

Happy hacking

Received on Sat May 08 2010 - 13:00:02 UTC

This archive was generated by hypermail 2.2.0 : Sat May 08 2010 - 13:12:01 UTC