-
16 Jun 2008 9:46 AM #1
how to change the size of the text in a ToggleToolItem?
how to change the size of the text in a ToggleToolItem?
I've tried a couple of things, but no workie:
Calling getBaseStyle() returns nullCode:homeItem = new ToggleToolItem(); homeItem.setStyleAttribute("font", "normal 18px tahoma"); homeItem.setStyleAttribute("x-btn-text", "normal 18px tahoma"); System.out.println("style=" + homeItem.getBaseStyle());
Thanks,
Mark
-
17 Jun 2008 12:49 AM #2
Maybe you can use:
For more information look at GWT Api class UIObject:Code:homeItem.addStyleName("cssClass"); or homeItem.addStyleDependentName("cssClass"); or homeItem.setStylePrimaryName("cssClass");
http://google-web-toolkit-doc-1-5.go...w-summary.html
-
17 Jun 2008 4:21 AM #3
Ugh, didn't think this would be so tough. Ah well, here is what I tried with no success:
toolBar.addStyleName("bigText");
toolBar.setStyleAttribute("font-size", "21");
homeItem.addStyleName("bigText");
homeItem.setStyleAttribute("font-size", "21");
Help!
Thanks,
Mark
-
17 Jun 2008 4:31 AM #4
Ugh, as well, can't seem to set a DataList to have a transparent background. I tried:
menuList.setStyleAttribute("background-color", "transparent");
menuItem.setStyleAttribute("background-color", "transparent");
Not sure if I'm missing something with regards to css handling or not...
-
17 Jun 2008 6:21 AM #5
OK, realized that I have to use camelCase (not the css style names) to change the styles programmatically.
DataList can be updated like this:
However, with the following code I can change the background color, but not the font size:Code:list.setStyleAttribute("backgroundColor", "transparent");
Any suggestions?Code:homeItem.setStyleAttribute("fontSize", "21px"); homeItem.setStyleAttribute("backgroundColor", "red");
Thanks,
Mark
-
17 Jun 2008 8:20 AM #6
setText is treated as HTML so you could do this:
However, tab item will not render properly with a font size > 11px.Code:item.setText("<span style='font-size: 12px'>GWT</span>");
-
17 Jun 2008 8:27 AM #7
OK, I won't go that route then, thanks for the info!


Reply With Quote