Intermec ck1 Reference Guide

Page of 390
Chapter 4 — SDK Components 
210 
CK1 SDK Programmer’s Reference Manual 
 
otk_widget_set_position(OTK_WIDGET(&enable_tog), 0, 0); 
 otk_widget_set_gc_background_color 
(OTK_WIDGET(&enable_tog), 
OTK_COL_WHITE); 
 otk_widget_set_gc_foreground_color 
(OTK_WIDGET(&enable_tog), 
OTK_COL_BLACK); 
 
otk_control_add_child (&contr1, OTK_WIDGET(&enable_tog));  
 otk_toggle_button_set_value(&enable_tog, 
OTK_FALSE); 
 otk_button_set_click_callback(OTK_BUTTON(&enable_tog), 
togglebutton_callback); 
 
 printf("RUN 
loop\n"); 
 return otk_app_loop(); 

 
 
OTK_BOOL range_callback (OtkWidget* sb, int x, int y) 

 
OtkRange* range = OTK_RANGE(sb); 
 
printf("__________range value______%d_______\n", range->value); 
 return 
OTK_TRUE; 

 
 
OTK_BOOL togglebutton_callback (OtkWidget* enable_tog_btn, int x, int y) 
{  
 
OtkToggleButton* tp = OTK_TOGGLE_BUTTON(enable_tog_btn); 
 
 
 otk_widget_set_sensitive(OTK_WIDGET(&scrollbar1),tp->value); 
// otk_widget_set_visible(OTK_WIDGET(&scrollbar2),tp->value); 
// otk_widget_redraw 
(OTK_WIDGET(&scrollbar2)); 
 
 return 
OTK_TRUE; 
OtkScrollBar2 
OtkScrollBar2 is a wrapper for a range control. The thumb of the scrollbar 
is dynamic. OtkScrollBar2 was inherited from OtkWidget and OtkRange. 
The properties are: 
Property 
Description 
“flag”(char:Read) 
Defines the orientation of the scrollbar (vertical: 0, 
horizontal: 1). 
“step”(int:Read) 
Defines the step of the scrollbar. 
 
 
otk_scrollbar2_init 
 
Purpose:  Initialize the OtkScrollBar2 instance. 
 
Prototype: 
void otk_scrollbar2_init (OtkScrollBar2* scrollbar);
 
 
Parameter:  scrollbar 
Pointer of the OtkScrollBar2 instance