// Change a widget's foreground and background colours. void wxDoChangeForegroundColour(WXWidget widget, wxColour& foregroundColour) { // When should we specify the foreground, if it's calculated // by wxComputeColours? // Solution: say we start with the default (computed) foreground colour. // If we call SetForegroundColour explicitly for a control or window, // then the foreground is changed. // Therefore SetBackgroundColour computes the foreground colour, and // SetForegroundColour changes the foreground colour. The ordering is // important. XtVaSetValues ((Widget) widget, XmNforeground, foregroundColour.AllocColour(XtDisplay((Widget) widget)), NULL); }