TTK

From wikiPodLinux

Quite simply, TTK is a GUI library for the iPod.

Table of contents

What can it do?

TTK is a higher-level GUI library for the iPod, a level above something like SDL or Nano-X, that works mostly with the concepts of windows and widgets. It is quite generic, but provides a few specific widgets to get you started: a menu, text viewer, image viewer, and slider.

TTK achieves semi-object-orientedness in C by using structures and function pointers extensively. For instance, you can override a widget's draw handler by just saying wid->draw = my_draw;. Events are handled similarly, with one handler for each event; they are somewhat higher-level than the events returned by the graphics library layer, including for instance held buttons, scrollwheel taps, etc.

Why should I use it?

Well, here's the (shortened) list from the introduction to the TTK API:

  • TTK is a higher-level library than what you're used to.
  • TTK has intelligent event handling.
  • TTK only draws your stuff when it needs to be drawn. (for the most part)
  • TTK acts as an abstraction layer between your code and a lower-level graphics library.
  • TTK makes easy things easier.
  • TTK makes some hard things easy.
  • TTK makes hard things possible.
  • TTK is extensible.

Good enough reasons? (The API has more detail about those points.)

Where do I get it?

The latest version is in SVN:

% svn co https://ipodlinux.svn.sourceforge.net/svnroot/ipodlinux/libs/ttk/
% make
% make install

Compile against it with e.g. gcc -o ttkapp ttkapp.c `ttk-config --ipod --sdl --cflags --libs`.

Alternatively, if you don't want to install it, you can use `/path/to/ttk/ttk-config-here flags` instead.

Get the API from "Ttk API.pdf.gz" (SVN r2329).

Hey, this is cool! Why isn't podzilla using it?

It is. It is in podzilla2.

Any example apps?

Sure; type make examples in the source tree. If you want to look at a slightly larger codebase, just look at podzilla2 or at the various modules. :-)

There's also the beginnings of a Perl language binding for TTK.

Author

Share and enjoy. Josh 23:32, 30 Oct 2005 (CST)

Retrieved from "http://ipodlinux.org/TTK"
Views
Personal tools