API - gabrield/stk GitHub Wiki

STK - Small Graphic Toolkit

STK - Small toolkit based on Xlib for GUI applications.

Widget Set
  • Window

  • Button

  • Text Area - still need some changes/improvements

  • Canvas - under development/test

  • ProgressBar - under test

  • Listbox - planned

STK Functions

stk_widget

The stk_widget functions are the base of STK. They are responsible for initializing the widget list, connect to display, set widget’s size, etc.

void stk_init()

Starts the widget list and connects to the display.

return void

Caution
This function MUST be called before any other stk function.
int stk_widget_insert(void *widget)

Alloc and insert a widget in the widget list. Every widget must call it to be registered and have its events handled.

return 0 if success, -1 if not

void stk_run()

Search for a widget in the widget list. It’s the event loop that handles the all the event callings of the widgets. Must be the last stk called.

return void

stk_widget *stk_widget_root()

Returns the pointer to first widget added the list.

return stk_widget*

stk_widget *stk_widget_search(void *widget)

Searchs for a widget in the widget list.

return stk_widget* if found or NULL

void stk_widget_set_pos(stk_widget *win, uint x, uint y)

Set widget position on the screen.

return void

⚠️ **GitHub.com Fallback** ⚠️