pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gk_br...@verizon.net>
Subject Re: How to create menu for MenuButton dynamically
Date Fri, 24 Jun 2011 15:32:48 GMT
The MenuHandler interface is generic - it applies to all components and is provided as a convenience
for configuring either:

a) a component-specific context ("right-click") menu
b) an application-wide frame menu bar

I don't understand how "configureMenuButton()" would fit into that model. All components can
have a context menu, and all components may be descendants of a frame that has a menu bar.
However, components don't "have" a menu button, so it's not clear what menu button MenuHandler#configureMenuButton()
would apply to, or when/how it would be triggered.

If I understand you correctly, I think what you are describing might be a new event or handler
on MenuButton itself. For example, MenuButton could fire a "menu about to be shown" or "menu
hidden" event that a caller could hook and use to populate/tear down the menu's contents.
However, the window open preview and window close events map well to this scenario, so I'm
not sure how much value there would be in creating new events specifically for this purpose.


On Jun 24, 2011, at 11:19 AM, Chris Bartlett wrote:

> I'll try rephrasing.
> Although I hadn't used MenuButtons before, I was aware of the MenuHandler interface.
> As the name suggested it handled Menus, I thought it would define some kind of a configureMenuButton()
method similar to configureMenuBar() and configureContextMenu().
> This is purely based on the class names - MenuBar & MenuButton.
> My expectation was that *if* such a method existed, it would be used to configure the
menu to be displayed by a MenuButton prior to the MenuButton's popup opening.  
> *If* a MenuHandler implementation contained such a method, I would only expect that method
to be executed in the above scenario, ie when that menu handler was set for a MenuButton instance.
 It would simply be ignored for any other Components.
> I just expected a callback similar to configureContextMenu/configureMenuBar to exist
*somewhere*, and be designed for use in the scenario Edvin described.  Perhaps it would be
defined in a MenuButton.Handler interface, but the generic 'MenuHandler' name suggested that
would  be the obvious place to look.  Edvin mentioned early on in the thread that it was where
he looked too.
> All of this derives from my take on the general consistency throughout Pivot.  
> Chris
> On 24 June 2011 21:55, Greg Brown <gk_brown@verizon.net> wrote:
> > When Edvin asked the question, my first thought was that MenuButton probably had
setMenuHandler() method, and MenuHandler had a corresponding configureMenuButton() method.
> >
> > Following activation of the MenuButton, the configureMenuButton() would be called
to populate the menu
> OK, but a menu button can be attached to any component. What would it do for non-MenuButton

View raw message