Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[riena-dev] Tips on widget.setBackground()

Hi,

I just fixed the flicker issues on resize. 


One thing I had to change was removing the SWT.INHERIT_FORCE style bit
from the main Shell, because it was causing flicker when some widgets
where resized (Group, Date, etc.).

	 /* SWT.INHERIT:
        *
        * The <code>Composite</code> constant to indicate that
	  * an attribute (such as background) is inherited by
	  * all children.
	  */

The side effect of removing it is that:


(a) the background color is not inherited from the Shell. You may notice
that some spots in the title area have now a gray background. 

	I'm in the process of fixing this.


(b) In the future, if you are creating an example you will notice that
some widgets (Composite, Group, Label) will have a gray background (i.e.
their default). For those widgets it is now more important to set the
background color. Before one could "forget" to do that and not notice
it, unless the alternate theme was used. 

The recommended way is to:

* use the Look-and-feel-Manager:

parent.setBackground(LnfManager.getLnf().getColor(ILnfKeyConstants.SUB_M
ODULE_BACKGROUND));
timeLabel.setBackground(LnfManager.getLnf().getColor(ILnfKeyConstants.ST
ATUSBAR_BACKGROUND));

* use the UIControlsFactory (currently in examples only):

UIControlsFactory.createLabel(group, "Name:");


Let me know if you have questions.

Regards,
Elias.

---
Elias Volanakis
Technical Lead
Innoopract, Inc.
351 NW 12th Avenue
Portland, Oregon 97209
Tel: +1-503-552-1457
Fax: +1-503-715-4915
Mobile: +1-503-929-5537
evolanakis@xxxxxxxxxxxxxx
http://rapblog.innoopract.com



Back to the top