Libstk::org

LibSTK::Tutorials

HelloWorld

Creating your first LibSTK application is simple enough. There are three main steps involved:

  1. Create the application object
  2. Create the widgets
  3. Start the application event loop.

Download hello_world.cpp.

Preparation (lines 13-21)

Of course, before we can code anything, we need to include the appropriate header files. Line 14 includes the standard libstk widgets an objects. Lines 17-18 include files corresponding to the specific backend we wish to use for our application. Lastly, to simplify the code we use the namespace stk.

Introduction to the LibSTK architecture

Basic Application Layout

LibSTK has been designed for embedded targets. The toolkit is written to work well without the need for a precision pointing device; precise movements, drags and clicks are not required to operate a user interface (UI) built with LibSTK.

LibSTK's UIs are state-based rather than window-based. States are similar to tabs in a tab_pane of other toolkits. One state is active at a time. The core application manages the widget tree and marshalls events to the appropriate widgets as they are received. A simple LibSTK program with one button would have a widget tree something like the following.

Syndicate content