Hi Werner,

Sebastian Werner schrieb:
> 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.

Thanks for taking the time. Does this mean that there's no way to add 
items to a menu once it is created? Or only while it is seeable? In this 
case we really had to recreate the menus.

> Alternatively you can maybe enable/disable items only which should be 
> less problematic.

The problem is that, in order to provide full SWT functionality (RAP), 
we have to make an AJAX request when the menu is about to show and ask 
the server for items to add or remove. Before we get the response, we 
show only one preliminary menu item (setting display to false for the 
others).

Is there a chance that hot adding / removing items from menus will be 
possible in future versions of qooxdoo? Otherwise I'm afraid we have to 
rewire the whole menu show / hide / cascade logic...

Thanks,
   Ralf

>> 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

Reply via email to