Intermec ck1 Reference Guide
Chapter 4 — SDK Components
CK1 SDK Programmer’s Reference Manual
217
otk_spin_set_min
Purpose: Set the minimum value of the spin.
Prototype:
void otk_spin_set_min (OtkSpin* spin, int min);
Parameters: spin
Pointer of the OtkSpin instance
min
Minimum value of the spin
Return: None
otk_spin_set_value
Purpose: Set the current value of the spin.
Prototype:
void otk_spin_set_value (OtkSpin* spin, int value);
Parameters: spin
Pointer of the OtkSpin instance
value
Current value of the spin
Return: None
Example Code
#include <stdio.h>
#include <stdlib.h>
#include "otkapplication.h"
#include "otkspin.h"
OTK_BOOL range_callback (OtkWidget*, int, int);
OTK_BOOL togglebutton_callback (OtkWidget*, int, int);
OtkControl contr1;
OtkSpin spin1;
OtkSpin spin2;
OtkToggleButton enable_tog;
int main()
{
otk_app_init(160,
#include <stdlib.h>
#include "otkapplication.h"
#include "otkspin.h"
OTK_BOOL range_callback (OtkWidget*, int, int);
OTK_BOOL togglebutton_callback (OtkWidget*, int, int);
OtkControl contr1;
OtkSpin spin1;
OtkSpin spin2;
OtkToggleButton enable_tog;
int main()
{
otk_app_init(160,
142);
otk_control_init
(&contr1);
otk_widget_set_size (OTK_WIDGET(&contr1), 160, 142);
otk_widget_set_gc_background_color
(OTK_WIDGET(&contr1),
OTK_COL_WHITE);
otk_app_add(&contr1);
otk_control_show(&contr1);
otk_app_add(&contr1);
otk_control_show(&contr1);
// set spin1
otk_spin_init
(&spin1);
otk_spin_set_typeflag (&spin1, 0); //VERTICAL_SPIN = 0,
HORIZONTAL_SPIN = 1
otk_spin_set_size (&spin1, 30, 30);
otk_spin_set_position (&spin1, 0, 30);
otk_spin_set_range(&spin1, 131, 0, 70);