Data Structures | |
struct | widget_context |
Widget application context. More... | |
Enumerations | |
enum | command_id { DUMMY_ID, SLIDER_ID, BUTTON_ID } |
Command event IDs. More... | |
Functions | |
bool | app_widget_launch (void) |
Setup widget demo. More... | |
static bool | widget_frame_command_handler (struct wtk_basic_frame *frame, win_command_t command_data) |
Frame handler for the application. More... | |
Variables | |
static struct widget_context * | widget_ctx |
Statically allocated context pointer. More... | |
enum command_id |
Command event IDs.
Enumerator | |
---|---|
DUMMY_ID |
Unused command event ID. |
SLIDER_ID | |
BUTTON_ID |
bool app_widget_launch | ( | void | ) |
Setup widget demo.
Allocates memory for the application context, and creates all widgets that make up its interface. If memory allocation or widget creation fails, the application exits immediately.
References win_attributes::area, BUTTON_ID, gfx_bitmap::color, gfx_bitmap::data, widget_context::frame, widget_context::frame_bg, GFX_BITMAP_SOLID, GFX_COLOR, GFX_COLOR_BLUE, GFX_COLOR_GREEN, GFX_COLOR_RED, GFX_COLOR_WHITE, membag_alloc(), membag_free(), win_window::parent, widget_context::plot, widget_context::plot_bg, win_area::pos, win_area::size, widget_context::slider, SLIDER_ID, gfx_bitmap::type, widget_frame_command_handler(), win_destroy(), win_get_attributes(), win_get_root(), win_inflate_area(), win_show(), wtk_basic_frame_as_child(), wtk_basic_frame_create(), wtk_button_as_child(), wtk_button_create(), wtk_plot_as_child(), wtk_plot_create(), WTK_PLOT_LEFT_TO_RIGHT, wtk_plot_set_grid(), WTK_PLOT_TICKS_VERTICAL, wtk_slider_as_child(), wtk_slider_create(), WTK_SLIDER_HORIZONTAL, win_point::x, and win_point::y.
Referenced by main().
|
static |
Frame handler for the application.
Handles all command events from the widgets in the application frame.
frame | Pointer to the application frame |
command_data | Command event ID |
References BUTTON_ID, widget_context::plot, widget_context::slider, win_redraw(), wtk_basic_frame_get_custom_data(), wtk_plot_add_value(), wtk_plot_as_child(), and wtk_slider_get_value().
Referenced by app_widget_launch().
|
static |
Statically allocated context pointer.