diff options
Diffstat (limited to 'iup/test/sample.c')
-rwxr-xr-x | iup/test/sample.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/iup/test/sample.c b/iup/test/sample.c index 038cffd..3c00d8d 100755 --- a/iup/test/sample.c +++ b/iup/test/sample.c @@ -138,6 +138,12 @@ static unsigned char img_bits2[] = ,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2 }; +static int copydata_cb(Ihandle* ih, char* value, int size) +{ + printf("COPYDATA(%s, %d)\n", value, size); + return IUP_DEFAULT; +} + static int valuechanged_cb(Ihandle *ih) { printf("VALUECHANGED_CB(%s)=%s\n", IupGetClassName(ih), IupGetAttribute(ih, "VALUE")); @@ -397,6 +403,11 @@ void SampleTest(void) // IupSetAttribute(box, "FGCOLOR", "255 0 0"); +// IupSetAttribute(dlg,"RASTERSIZE","1000x800"); + + IupSetCallback(dlg, "COPYDATA_CB", (Icallback)copydata_cb); + + IupMap(dlg); IupSetAttribute(tree, "TITLE0", "Figures"); @@ -407,6 +418,8 @@ void SampleTest(void) IupSetAttribute(tree, "ADDLEAF4", "scalenus"); IupShow(dlg); + +// IupSetAttribute(dlg,"RASTERSIZE", NULL); } #ifndef BIG_TEST @@ -414,6 +427,13 @@ int main(int argc, char* argv[]) { IupOpen(&argc, &argv); + IupSetGlobal("SINGLEINSTANCE", "Iup Sample"); + if (!IupGetGlobal("SINGLEINSTANCE")) + { + IupClose(); + return EXIT_SUCCESS; + } + SampleTest(); IupMainLoop(); |