comparison lwlib/lwlib-Xm.c @ 639:4b7d425dd3c2

[xemacs-hg @ 2001-07-28 05:08:58 by andyp] Stop flickering on OpenMotif.
author andyp
date Sat, 28 Jul 2001 05:09:03 +0000
parents c33ae14dd6d0
children e5083672c894
comparison
equal deleted inserted replaced
638:373ced43e288 639:4b7d425dd3c2
334 XtSetValues (widget, al, 1); 334 XtSetValues (widget, al, 1);
335 XtRemoveAllCallbacks (widget, XmNactivateCallback); 335 XtRemoveAllCallbacks (widget, XmNactivateCallback);
336 XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance); 336 XtAddCallback (widget, XmNactivateCallback, xm_generic_callback, instance);
337 } 337 }
338 338
339 static void
340 xm_update_progress (widget_instance* instance, Widget scale,
341 widget_value* val)
342 {
343 Arg al[20];
344 int ac = 0;
345 Dimension height = 0;
346 Dimension width = 0;
347 if (!val->call_data)
348 {
349 XtSetArg (al [ac], XmNeditable, False); ac++;
350 }
351 else
352 {
353 XtSetArg (al [ac], XmNeditable, val->enabled); ac++;
354 }
355 height = (Dimension)lw_get_value_arg (val, XtNheight);
356 width = (Dimension)lw_get_value_arg (val, XtNwidth);
357 if (height > 0)
358 {
359 XtSetArg (al [ac], XmNscaleHeight, height); ac++;
360 }
361 if (width > 0)
362 {
363 XtSetArg (al [ac], XmNscaleWidth, width); ac++;
364 }
365
366 XtSetValues (scale, al, 1);
367 }
368
339 #ifdef LWLIB_MENUBARS_MOTIF 369 #ifdef LWLIB_MENUBARS_MOTIF
340 370
341 static void 371 static void
342 xm_update_cascadebutton (widget_instance* instance, Widget widget, 372 xm_update_cascadebutton (widget_instance* instance, Widget widget,
343 widget_value* val) 373 widget_value* val)
856 else if (class == xmScrollBarWidgetClass) 886 else if (class == xmScrollBarWidgetClass)
857 { 887 {
858 xm_update_scrollbar (instance, widget, val); 888 xm_update_scrollbar (instance, widget, val);
859 } 889 }
860 #endif 890 #endif
891 else if (class == xmScaleWidgetClass)
892 {
893 xm_update_progress (instance, widget, val);
894 }
861 /* Lastly update our global arg values. */ 895 /* Lastly update our global arg values. */
862 if (val->args && val->args->nargs) 896 if (val->args && val->args->nargs)
863 XtSetValues (widget, val->args->args, val->args->nargs); 897 XtSetValues (widget, val->args->args, val->args->nargs);
864 } 898 }
865 899
910 } 944 }
911 945
912 if (radiobox) 946 if (radiobox)
913 { 947 {
914 CompositeWidget radio = (CompositeWidget)widget; 948 CompositeWidget radio = (CompositeWidget)widget;
915 int i; 949 unsigned int i;
916 for (i = 0; i < radio->composite.num_children; i++) 950 for (i = 0; i < radio->composite.num_children; i++)
917 { 951 {
918 int set = False; 952 int set = False;
919 Widget toggle = radio->composite.children [i]; 953 Widget toggle = radio->composite.children [i];
920 Arg al [1]; 954 Arg al [1];
1647 static Widget 1681 static Widget
1648 xm_create_progress (widget_instance *instance) 1682 xm_create_progress (widget_instance *instance)
1649 { 1683 {
1650 Arg al[20]; 1684 Arg al[20];
1651 int ac = 0; 1685 int ac = 0;
1686 Dimension height = 0;
1687 Dimension width = 0;
1652 Widget scale = 0; 1688 Widget scale = 0;
1653 widget_value* val = instance->info->val; 1689 widget_value* val = instance->info->val;
1654 #if 0 /* This looks too awful, although more correct. */
1655 if (!val->call_data) 1690 if (!val->call_data)
1656 { 1691 {
1657 XtSetArg (al [ac], XmNsensitive, False); ac++; 1692 XtSetArg (al [ac], XmNeditable, False); ac++;
1658 } 1693 }
1659 else 1694 else
1660 { 1695 {
1661 XtSetArg (al [ac], XmNsensitive, val->enabled); ac++; 1696 XtSetArg (al [ac], XmNeditable, val->enabled); ac++;
1662 } 1697 }
1663 #else
1664 XtSetArg (al [ac], XmNsensitive, True); ac++;
1665 #endif
1666 XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++; 1698 XtSetArg (al [ac], XmNalignment, XmALIGNMENT_BEGINNING); ac++;
1667 XtSetArg (al [ac], XmNuserData, val->call_data); ac++; 1699 XtSetArg (al [ac], XmNuserData, val->call_data); ac++;
1668 XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++; 1700 XtSetArg (al [ac], XmNmappedWhenManaged, FALSE); ac++;
1669 XtSetArg (al [ac], XmNorientation, XmHORIZONTAL); ac++; 1701 XtSetArg (al [ac], XmNorientation, XmHORIZONTAL); ac++;
1670 /* The highlight doesn't appear to be dynamically set which makes it 1702 /* The highlight doesn't appear to be dynamically set which makes it
1671 look ugly. I think this may be a LessTif bug but for now we just 1703 look ugly. I think this may be a LessTif bug but for now we just
1672 get rid of it. */ 1704 get rid of it. */
1673 XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++; 1705 XtSetArg (al [ac], XmNhighlightThickness, (Dimension)0);ac++;
1706
1707 height = (Dimension)lw_get_value_arg (val, XtNheight);
1708 width = (Dimension)lw_get_value_arg (val, XtNwidth);
1709 if (height > 0)
1710 {
1711 XtSetArg (al [ac], XmNscaleHeight, height); ac++;
1712 }
1713 if (width > 0)
1714 {
1715 XtSetArg (al [ac], XmNscaleWidth, width); ac++;
1716 }
1717
1674 /* add any args the user supplied for creation time */ 1718 /* add any args the user supplied for creation time */
1675 lw_add_value_args_to_args (val, al, &ac); 1719 lw_add_value_args_to_args (val, al, &ac);
1676 1720
1677 scale = XmCreateScale (instance->parent, val->name, al, ac); 1721 scale = XmCreateScale (instance->parent, val->name, al, ac);
1678 if (val->call_data) 1722 if (val->call_data)