Hi Ralf, I am sorry, but I don't think this is possible with the current versions. I even don't know of any work-around. I just spend some minutes again to find some hack, but nothing useful found.
Alternatively you can maybe enable/disable items only which should be less problematic. Otherwise the only way would be to recreate the menu. Regards, Sebastian Ralf Sternberg schrieb: > Hi, > > I'm trying to add or delete menu items (e.g. qx.ui.menu.Button) to/from > a qx.ui.menu.Menu while the menu is currently seeable. Unfortunately, > the width of the menu is not updated. As a result, if one of the added > menu items is larger than the existing menu, the menu appears with its > old width (see attached screenshot). Calling menu.pack() after adding > items doesn't help. > > Is this generally impossible to add menu items while the menu is seeable > or is there any way to refresh the menu bounds after adding items? > > Some (although not very useful) code to reproduce: > > // set up context-menu > var cmenu = new qx.ui.menu.Menu(); > cmenu.addToDocument(); > > // setup initial item > var m_1 = new qx.ui.menu.Button( "Simple" ); > cmenu.add( m_1 ); > m_1.addEventListener( "mouseover", function( e ) { > var item = new qx.ui.menu.Button( "Additional Item" ); > this.add( item ); > }, cmenu ); > > // show the context-menu to widget w > w.setContextMenu( cmenu ); > w.addEventListener( "contextmenu", function( e ) { > this.getContextMenu().setLeft( e.getClientX() ); > this.getContextMenu().setTop( e.getClientY() ); > this.getContextMenu().setOpener( this ); > this.getContextMenu().show(); > }, w ); > > Thanks in advance, > Ralf > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > ------------------------------------------------------------------------ > > _______________________________________________ > qooxdoo-devel mailing list > qooxdoo-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel