It would be very nice if we could add widgets to MenuItems instead of using setting html. This would make formatting of custom menu items a lot easier. I just tried to add menu items that display text + an aligned image and it took some time to find out how to do that (nesting a table).
On Jan 20, 4:26 pm, John LaBanca <jlaba...@google.com> wrote: > The fact that MenuBar uses a table to render itself is just an > implementation detail, and sometimes we abstract away the DOM implementation > of a widget. Personally, I think adding a setHorizontal/VerticalAlignment() > would be a little confusing because people might assume it would set the > alignment of the widget itself (as in position to widget) as opposed to > setting the alignment of the MenuItems in the cells. There are other table > based widgets that do not have these methods for the same reason, such as > StackPanel. Also, you can always set styles in code using the Element > methods: > > myMenu.getElement().getStyle().setProperty("name", "value"); > > > > Still, I'll be interested to see what other contributors think. Maybe there > is a use case for this method in other widgets as well. > > Thanks, > John LaBanca > jlaba...@google.com > > > > On Mon, Jan 19, 2009 at 12:50 PM, jack.yang <jackyang0...@gmail.com> wrote: > > > Since this widget is a Div which contains a Table, why it do not have > > a method to set its cell alignment? This is not the only widget which > > consists of a table but do not have a method to set alignment. > > > I think this is not a good design. For some widget developers set > > alignment by code while for others they can only set alignment using > > CSS. --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---