PDA

View Full Version : Show menus on mouse over



cvs_fif
5 Aug 2009, 7:38 AM
To moderators: please remove this from here, it's belonging to the forum on 1.2.x...

In GXT 1.2.4, I'm trying to slightly change the behaviour of the tool button menus. Originally, I have something like this:



TextToolItem toolItem=new TextToolItem();
// The menu variable is filled somewhere before
toolItem.setMenu(menu);


In this case, the menu is shown when the button is _clicked_. I would like to change this and to show the menu just when the mouse is over the button (yes, I know how the split button works, it doesn't solve my problem). The problem is that when I do:



toolItem.sinkEvents(Event.ONMOUSEOVER);
toolItem.addListener(Events.OnMouseOver, new Listener <ComponentEvent> (){
public void handleEvent(ComponentEvent ce){
// The code here is never executed
}
}


...I simply don't receive any mouse events, so there is nothing I can do with this...

Any ideas on how to solve it?