summaryrefslogtreecommitdiff
path: root/iup/src/mot/iupmot_button.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/src/mot/iupmot_button.c
parentccc8261e4d48de89da4ddfe7b55e378ae0cd6f47 (diff)
Upgrading to iup 3.1
Diffstat (limited to 'iup/src/mot/iupmot_button.c')
-rwxr-xr-xiup/src/mot/iupmot_button.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/iup/src/mot/iupmot_button.c b/iup/src/mot/iupmot_button.c
index 2d93588..f6e383f 100755
--- a/iup/src/mot/iupmot_button.c
+++ b/iup/src/mot/iupmot_button.c
@@ -112,8 +112,10 @@ static int motButtonSetPaddingAttrib(Ihandle* ih, const char* value)
{
XtVaSetValues(ih->handle, XmNmarginHeight, ih->data->vert_padding,
XmNmarginWidth, ih->data->horiz_padding, NULL);
+ return 0;
}
- return 0;
+ else
+ return 1; /* store until not mapped, when mapped will be set again */
}
static int motButtonSetBgColorAttrib(Ihandle* ih, const char* value)
@@ -189,43 +191,43 @@ static int motButtonMapMethod(Ihandle* ih)
if (value)
{
ih->data->type = IUP_BUTTON_IMAGE;
- iupmotSetArg(args, num_args, XmNlabelType, XmPIXMAP);
+ iupMOT_SETARG(args, num_args, XmNlabelType, XmPIXMAP);
}
else
{
ih->data->type = IUP_BUTTON_TEXT;
- iupmotSetArg(args, num_args, XmNlabelType, XmSTRING);
+ iupMOT_SETARG(args, num_args, XmNlabelType, XmSTRING);
}
/* Core */
- iupmotSetArg(args, num_args, XmNmappedWhenManaged, False); /* not visible when managed */
- iupmotSetArg(args, num_args, XmNx, 0); /* x-position */
- iupmotSetArg(args, num_args, XmNy, 0); /* y-position */
- iupmotSetArg(args, num_args, XmNwidth, 10); /* default width to avoid 0 */
- iupmotSetArg(args, num_args, XmNheight, 10); /* default height to avoid 0 */
+ iupMOT_SETARG(args, num_args, XmNmappedWhenManaged, False); /* not visible when managed */
+ iupMOT_SETARG(args, num_args, XmNx, 0); /* x-position */
+ iupMOT_SETARG(args, num_args, XmNy, 0); /* y-position */
+ iupMOT_SETARG(args, num_args, XmNwidth, 10); /* default width to avoid 0 */
+ iupMOT_SETARG(args, num_args, XmNheight, 10); /* default height to avoid 0 */
/* Label */
- iupmotSetArg(args, num_args, XmNrecomputeSize, False); /* no automatic resize from text */
- iupmotSetArg(args, num_args, XmNmarginHeight, 0); /* default padding */
- iupmotSetArg(args, num_args, XmNmarginWidth, 0);
- iupmotSetArg(args, num_args, XmNmarginTop, 0); /* no extra margins */
- iupmotSetArg(args, num_args, XmNmarginLeft, 0);
- iupmotSetArg(args, num_args, XmNmarginBottom, 0);
- iupmotSetArg(args, num_args, XmNmarginRight, 0);
+ iupMOT_SETARG(args, num_args, XmNrecomputeSize, False); /* no automatic resize from text */
+ iupMOT_SETARG(args, num_args, XmNmarginHeight, 0); /* default padding */
+ iupMOT_SETARG(args, num_args, XmNmarginWidth, 0);
+ iupMOT_SETARG(args, num_args, XmNmarginTop, 0); /* no extra margins */
+ iupMOT_SETARG(args, num_args, XmNmarginLeft, 0);
+ iupMOT_SETARG(args, num_args, XmNmarginBottom, 0);
+ iupMOT_SETARG(args, num_args, XmNmarginRight, 0);
/* PushButton */
- iupmotSetArg(args, num_args, XmNfillOnArm, False);
+ iupMOT_SETARG(args, num_args, XmNfillOnArm, False);
/* Primitive */
if (iupAttribGetBoolean(ih, "FOCUSONCLICK"))
{
if (iupAttribGetBoolean(ih, "CANFOCUS"))
- iupmotSetArg(args, num_args, XmNtraversalOn, True);
+ iupMOT_SETARG(args, num_args, XmNtraversalOn, True);
else
- iupmotSetArg(args, num_args, XmNtraversalOn, False);
+ iupMOT_SETARG(args, num_args, XmNtraversalOn, False);
}
else
- iupmotSetArg(args, num_args, XmNtraversalOn, False);
- iupmotSetArg(args, num_args, XmNhighlightThickness, 2);
- iupmotSetArg(args, num_args, XmNnavigationType, XmTAB_GROUP);
+ iupMOT_SETARG(args, num_args, XmNtraversalOn, False);
+ iupMOT_SETARG(args, num_args, XmNhighlightThickness, 2);
+ iupMOT_SETARG(args, num_args, XmNnavigationType, XmTAB_GROUP);
ih->handle = XtCreateManagedWidget(
iupDialogGetChildIdStr(ih), /* child identifier */