Cascade Button colors

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
Cascade Button colors

Submitted by Anonymous on Tue, 03/07/2006 - 22:09.

I've built openmotif 2.3 beta 1 on SuSe 9.3 x86_64. I have found one weird problem. If we programatically change the foreground/background of CascadeButton it only changes the colors immediately around the text label. All the rest of the widget between the label and and top/bottom shadows retain their original pixel values. If fixed this (I think) by tweaking SetValues in CascadeB.c to call GetBackgroundGC if the foreground or background pixel values have changed. Its been about 14 or 15 years since I mucked around in the internals of Motif so please pardon me if there is a better fix.

# diff -u CascadeB.c.orig CascadeB.c
--- CascadeB.c.orig 2006-03-07 16:04:30.697866400 -0600
+++ CascadeB.c 2006-03-07 16:05:10.023887936 -0600
@@ -2087,6 +2087,13 @@
menuSTrait = (XmMenuSystemTrait)
XmeTraitGet((XtPointer) XtClass(XtParent(cw)), XmQTmenuSystem);

+ /* kjh: Update the GC if the foreground or background are changed
+ */
+ if (old->primitive.foreground != new_w->primitive.foreground
+ || old->core.background_pixel != new_w->core.background_pixel) {
+ GetBackgroundGC(new_w);
+ }
+
if ((CB_Submenu(new_w)) &&
((! XmIsRowColumn(CB_Submenu(new_w))) ||
(RC_Type(CB_Submenu(new_w)) != XmMENU_PULLDOWN)))

Fri, 04/07/2006 - 04:53#1

Fri, 04/07/2006 - 04:53#1

bkat

Cascade Button colors

Thanks again to the motif team for accepting my bug fix for this issue (bug #1331 I think).