summaryrefslogtreecommitdiff
path: root/iup/test/spin.c
blob: 63a3bbcb5100c9a8921732c7948b585cdeb1f186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <stdlib.h>
#include <stdio.h>

#include "iup.h"


static int spin_cb(Ihandle* ih, int inc)
{
  (void)ih;
  /* does nothing, just print the call */
  printf("SPIN_CB(%d)\n", inc);
  return IUP_DEFAULT;
}

void SpinTest(void)
{
  Ihandle *dlg, *spinbox;

  spinbox = IupSpinbox(IupSetAttributes(IupText(NULL), "SIZE=50x"));

  IupSetCallback(spinbox, "SPIN_CB", (Icallback)spin_cb);

  dlg = IupDialog(IupVbox(spinbox, NULL));
  IupSetAttribute(dlg, "MARGIN", "10x10");

  IupSetAttribute(dlg, "TITLE", "IupSpin Test");
  IupShow(dlg);
}

#ifndef BIG_TEST
int main(int argc, char* argv[])
{
  IupOpen(&argc, &argv);

  SpinTest();

  IupMainLoop();

  IupClose();

  return EXIT_SUCCESS;
}
#endif