2011-04-26

FLTK 1.3 功能介紹

FLTK 本身是設計成靜態連結,不過它也可以配合動態連結,就看user的選擇。



以下是FLTK特有的核心功能:

  • sizeof(Fl_Widget) == 64 to 92.
  • "core" (在486機器下,利用gcc編譯且連結靜態FLTK函式庫的"hello" 程式,再壓縮) 程式大小約114K.
  • FLUID 程式 (包涵所有Widget) 為 538k.
  • Written directly atop core libraries (Xlib, WIN32 or Cocoa) for maximum speed, and carefully optimized for code size and performance.
  • Precise low-level compatibility between the X11, WIN32 and MacOS versions - only about 10% of the code is different.
  • Interactive user interface builder program. Output is human-readable and editable C++ source code.
  • Support for overlay hardware, with emulation if none is available.
  • Very small & fast portable 2-D drawing library to hide Xlib, WIN32, or QuickDraw.
  • OpenGL/Mesa drawing area widget.
  • Support for OpenGL overlay hardware on both X11 and WIN32, with emulation if none is available.
  • Text widgets with cut & paste, undo, and support for Unicode text and international input methods.
  • Compatibility header file for the GLUT library.
  • Compatibility header file for the XForms library.

以下是一個FLTK的範例
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>

int main(int argc, char **argv) {
  Fl_Window *window = new Fl_Window(340,180);
  Fl_Box *box = new Fl_Box(20,40,300,100,"Hello, World!");
  box->box(FL_UP_BOX);
  box->labelfont(FL_BOLD+FL_ITALIC);
  box->labelsize(36);
  box->labeltype(FL_SHADOW_LABEL);
  window->end();
  window->show(argc, argv);
  return Fl::run();
}

沒有留言: