Menu

#6 a start at a menubar

open
nobody
None
5
2012-04-09
2004-07-08
Kris Raney
No

This menubutton class shows PopUpMenus at the right
location:

public class MenuButton extends Button {
private PopUpMenu list;
public MenuButton(String label, PopUpMenu inlist) {
super(label);
this.list = inlist;
addListener(new ActionListener() {
/ (non-Javadoc)
* @see
jcurses.event.ActionListener#actionPerformed(jcurses.event.ActionEvent)
/
public void actionPerformed(ActionEvent
event) {
list.setX(getAbsoluteX());
list.setY(getAbsoluteY());
list.show();
}
});

}

}

Also requires setX() and setY() to be added to the
PopUpMenu class

This still doesn't support the expected functionality
of right & left arrows moving between PopUpMenus within
the same menubar.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.