summaryrefslogtreecommitdiff
path: root/iup/src/mot/iupmot_label.c
diff options
context:
space:
mode:
Diffstat (limited to 'iup/src/mot/iupmot_label.c')
-rwxr-xr-xiup/src/mot/iupmot_label.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/iup/src/mot/iupmot_label.c b/iup/src/mot/iupmot_label.c
index 52dfc9a..afff3c3 100755
--- a/iup/src/mot/iupmot_label.c
+++ b/iup/src/mot/iupmot_label.c
@@ -147,8 +147,10 @@ static int motLabelSetPaddingAttrib(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 motLabelMapMethod(Ihandle* ih)
@@ -165,12 +167,12 @@ static int motLabelMapMethod(Ihandle* ih)
if (iupStrEqualNoCase(value, "HORIZONTAL"))
{
ih->data->type = IUP_LABEL_SEP_HORIZ;
- iupmotSetArg(args, num_args, XmNorientation, XmHORIZONTAL);
+ iupMOT_SETARG(args, num_args, XmNorientation, XmHORIZONTAL);
}
else /* "VERTICAL" */
{
ih->data->type = IUP_LABEL_SEP_VERT;
- iupmotSetArg(args, num_args, XmNorientation, XmVERTICAL);
+ iupMOT_SETARG(args, num_args, XmNorientation, XmVERTICAL);
}
}
else
@@ -180,32 +182,32 @@ static int motLabelMapMethod(Ihandle* ih)
if (value)
{
ih->data->type = IUP_LABEL_IMAGE;
- iupmotSetArg(args, num_args, XmNlabelType, XmPIXMAP);
+ iupMOT_SETARG(args, num_args, XmNlabelType, XmPIXMAP);
}
else
{
ih->data->type = IUP_LABEL_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 */
/* Primitive */
- iupmotSetArg(args, num_args, XmNtraversalOn, False);
- iupmotSetArg(args, num_args, XmNhighlightThickness, 0);
+ iupMOT_SETARG(args, num_args, XmNtraversalOn, False);
+ iupMOT_SETARG(args, num_args, XmNhighlightThickness, 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);
ih->handle = XtCreateManagedWidget(
iupDialogGetChildIdStr(ih), /* child identifier */