The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

PayamFard (23) [Avatar] Offline
#1
I have a GWT tree in which the leaf nodes are HorizontalPanels that
include a label and an image. I also have defined the following
entries in my css file:

.gwt-Tree .gwt-TreeItem-selected {
background-color: yellow;



}


I have 2 questions on this:

1) When I select a non-leaf node, the background color of the selected
node becomes yellow which is good, but when I select one of these leaf
nodes, the background color does not change so it would be hard to
know that a node is actually selected. What should I do here to make
sure the background color of the HorizontalPanel changes?


2) How can I make sure the Label is centered in the middle of the
image when they are added to the HorizontalPanel?


Thanks in advance.
robert.hanson (173) [Avatar] Offline
#2
Re: Selected HorizontalPanel background in a tree
These questions are probably better asked on the GWT forum.

http://groups.google.com/group/Google-Web-Toolkit

> What should I do here to make sure the background
> color of the HorizontalPanel changes?

Probably this, but I am guessing a bit.

.gwt-Tree .gwt-TreeItem-selected table {
background-color: yellow;
}

> 2) How can I make sure the Label is centered in the
> middle of the image when they are added to the
> HorizontalPanel?

I have run into this a few rimes in my career, but I don't recall the answer. I believe there is a vertical align CSS property.