summaryrefslogtreecommitdiff
path: root/iup/test/sample.c
diff options
context:
space:
mode:
authorPixel <pixel@nobis-crew.org>2010-06-15 00:59:57 -0700
committerPixel <pixel@nobis-crew.org>2010-06-15 00:59:57 -0700
commiteed0eb6a476d54ce19aeff137984aa981d9e3976 (patch)
tree807891636efd2f87dcbd261e971216269973ae07 /iup/test/sample.c
parentccc8261e4d48de89da4ddfe7b55e378ae0cd6f47 (diff)
Upgrading to iup 3.1
Diffstat (limited to 'iup/test/sample.c')
-rwxr-xr-xiup/test/sample.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/iup/test/sample.c b/iup/test/sample.c
index e99617d..038cffd 100755
--- a/iup/test/sample.c
+++ b/iup/test/sample.c
@@ -185,6 +185,24 @@ static int help_cb(Ihandle* ih)
return IUP_DEFAULT;
}
+static int action1_cb(Ihandle* ih)
+{
+ IupSetAttribute(IupGetDialog(ih), "BACKGROUND", "255 128 128");
+ return IUP_DEFAULT;
+}
+
+static int action2_cb(Ihandle* ih)
+{
+ IupSetAttribute(IupGetDialog(ih), "BGCOLOR", "0 128 0");
+ return IUP_DEFAULT;
+}
+
+static int action3_cb(Ihandle* ih)
+{
+ IupSetAttribute(IupGetChild(IupGetDialog(ih), 0), "BGCOLOR", "128 0 0");
+ return IUP_DEFAULT;
+}
+
static Ihandle* set_callbacks(Ihandle* ih)
{
IupSetCallback(ih, "VALUECHANGED_CB", (Icallback)valuechanged_cb);
@@ -237,9 +255,9 @@ void SampleTest(void)
_frm_1 = IupFrame(
IupVbox(
set_callbacks(IupSetAttributes(IupButton("Button Text", NULL), "PADDING=5x5")),
- set_callbacks(IupSetAttributes(IupButton("Text", NULL), "IMAGE=img1, PADDING=5x5")),
- set_callbacks(IupSetAttributes(IupButton(NULL, NULL), "IMAGE=img1")),
- set_callbacks(IupSetAttributes(IupButton("", NULL), "IMAGE=img1,IMPRESS=img2")),
+ IupSetCallbacks(set_callbacks(IupSetAttributes(IupButton("Text", NULL), "IMAGE=img1, PADDING=5x5")),"ACTION", action1_cb, NULL),
+ IupSetCallbacks(set_callbacks(IupSetAttributes(IupButton(NULL, NULL), "IMAGE=img1")),"ACTION", action2_cb, NULL),
+ IupSetCallbacks(set_callbacks(IupSetAttributes(IupButton("", NULL), "IMAGE=img1,IMPRESS=img2")),"ACTION", action3_cb, NULL),
NULL));
IupSetAttribute(_frm_1,"TITLE","IupButton");