Otk - Open Tool Kit
Otk is a portable widget library for making graphical user interfaces (GUI's) for application programs. It emphasizes simplicity without eliminating capability. Open graphics Tool Kit supports neutrally: Linux, Unix, Microsoft Windows, and Mac OSX. It is based on OpenGL, and C. Otk provides the following basic widgets:
- * Panel - The "container" widget.
* Text Label - Text labels.
* Button - Buttons with labels and call-backs to user functions.
* Text Form Box - Accept text with function call-back. Also scrollable editor window.
* Pull-down Menu - Display hierarchical menu-lists with user function call-backs on mouse release.
* Slider Control - Slider control with call-back.
* Sub-windows - Detachable self-managed windows.
* Many other widgets ...
* Gadgets - High level widgets.
Although initially intended for use with C programs, Otk can be accessed from, or extended to, other languages. Otk addresses several issues with previous graphics toolkits, such as X-Windows, X-Motif, MFC, Tcl/TK, Gtk, Awt, Swing, Glow, FLTK, etc..
Otk deviates from previous graphics environments in several important ways.
- * Based on OpenGL - Well supported on most platforms. Clients tend to have the right support files. Easily builds on all platforms. Uses graphics card acceleration when available. Common look and feel. Contains internal default font with arbitrary scale, boldness and slant. Additional fonts can be added.
- * API designed from application programmer's viewpoint - Simplified interface. Sensible defaults. Most common functions require one line. But flexibility is not limited because defaults can be modified.
- * Minimal library files - Link to-, or include-, one file.
- * Direct window-size % relative layout - Specify positions and sizes as percentage of container window. Resizing is automatic and proportional. Traditional pixel-coordinate or framework modes can also be supported.
- * Colors can be expressed directly as r,g,b values. (No indirect color index tables.)
A quick test of a graphic environment's simplicity is to look at what it takes to do the simple helloworld example. Here is the Otk version of helloworld.c for comparison to other graphics toolkits.
#include "otk_lib/otk_lib.c"
main( int argc, char **argv )
{
OtkInitWindow( 350, 140, argc, argv );
OtkMakeButton( OtkOuterWindow, 10.0, 10.0, 80.0, 80.0, "Hello World !", 0, 0 );
OtkMainLoop();
}
Coordinate System:
To simplify window design, all coordinates are expressed in percentages of the container window or widget. The upper left is 0.0%, the lower right is 100.0%. This enables automatic resizing without additional code in each application. (Alternatives would be to specify coordinates in pixels or other arbitrary coordinate systems such as points, cm, or inches. You are always free to convert any such coordinates into percent window size.) Background/foreground eclipsing is handled automatically by the underlying OpenGL functions. The Otk calls manage their own hierarchy and depth.
Window Hierarchy:
The outermost container window (the first window itself) is called, OtkOuterWindow. All subsequent windows are children (or children-of-children, etc.) of the OtkOuterWindow.
and manny more ->Otk