https://bugzilla.novell.com/show_bug.cgi?id=230496 ------- Comment #10 from sh@novell.com 2007-02-14 03:48 MST ------- For one thing, there is a mechanism to do this: Wrap the MenuButton with a ReplacePoint and exchange the whole MenuButton. This is absolutely transparent to the user. As a matter of fact, this is the way had used to exchange the contents of SelectionBox etc. widgets until about one year ago. What Jiri wants here is a simpler API to do the same thing. And this is what frankly I see very little use for. It should not be so common a use case to change the content of menus on the fly that we need a very optimized API for it. To the contrary, in most cases I would strongly advise against changing menu entries dynamically at all. Of course, there are valid use cases for this, but only a few. Technically, the benefit is minimal. There is no performance gain whatsoever because the same data structures need to be parsed, most of what a menu button is all about needs to be destroyed internally one way or the other (what is left of a menu button when you exchange its contents? Little more than the frame around it that marks it as a button-like widget), and the absolute same amount of geometry management is necessary. So the only benefit is to make the code using it a little prettier. But only a very little. You need just the same amount of complex data structures for the menu description. Existing code would do this: UI::ReplaceWidget(`rep_menu, `MenuButton( "&Create", [ `item(`id(`folder), "&Folder" ), `menu( "&Document", [ `item(`id(`text), "&Text File" ), `item(`id(`image), "&Image" ) ] ) ] ) ); While what Jiri suggests would use this: UI::ChangeWidget(`menu, `Items, [ `item(`id(`folder), "&Folder" ), `menu( "&Document", [ `item(`id(`text), "&Text File" ), `item(`id(`image), "&Image" ) ] ) ] ); This is not any simpler, nor does it add any functionality. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.