summaryrefslogtreecommitdiff
path: root/iup/test/spin.c
diff options
context:
space:
mode:
Diffstat (limited to 'iup/test/spin.c')
-rwxr-xr-xiup/test/spin.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/iup/test/spin.c b/iup/test/spin.c
new file mode 100755
index 0000000..63a3bbc
--- /dev/null
+++ b/iup/test/spin.c
@@ -0,0 +1,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