View Full Version : [FIXED] Menu item text too long for menu

4 May 2008, 1:13 AM
If I create a menu with a menu item which has a long description, then the menu item description overflows the edge of the menu. eg

package com.radworkz.test.gxt;

import com.extjs.gxt.ui.client.widget.menu.Menu;
import com.extjs.gxt.ui.client.widget.menu.TextMenuItem;
import com.extjs.gxt.ui.client.widget.toolbar.TextToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.RootPanel;

public class TestGxt implements EntryPoint {

* @see com.google.gwt.core.client.EntryPoint#onModuleLoad()
public final void onModuleLoad() {

ToolBar toolbar = new ToolBar();

TextToolItem toolItem = new TextToolItem("Menu 1");

Menu menu = new Menu();
menu.add(new TextMenuItem("Item 1"));
menu.add(new TextMenuItem("Overly Long Text For Item 2"));


I tried using menu.setAutoWidth(true), however this did not seem to have any effect (should it?).

I've attached a screenshot of the result of running the above code.

Using GXT 1.0-Beta-2, GWT 1.5-M2, on Ubuntu 8.04.

4 May 2008, 7:06 PM
The fix is in SVN.

5 May 2008, 1:36 AM
Many thanks, works fine now using revision 103 from SVN.