X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTMenu.java;h=bc1bc3596bb2944eda6da12e5cd366fef1edaf70;hb=fca67db090dc7e6476b98b800ce225c2bf60425c;hp=b0873f01ff72c618ea29df3192e7a351708f7522;hpb=a06459bd6b0e65c9b590dbdf6ed9349043119215;p=fanfix.git diff --git a/src/jexer/TMenu.java b/src/jexer/TMenu.java index b0873f0..bc1bc35 100644 --- a/src/jexer/TMenu.java +++ b/src/jexer/TMenu.java @@ -47,6 +47,15 @@ public class TMenu extends TWindow { */ private MnemonicString mnemonic; + /** + * Get the mnemonic string. + * + * @return the full mnemonic string + */ + public final MnemonicString getMnemonic() { + return mnemonic; + } + // Reserved menu item IDs public static final int MID_UNUSED = -1; @@ -92,15 +101,15 @@ public class TMenu extends TWindow { parent.closeWindow(this); // Setup the menu shortcut - mnemonic = new MnemonicString(title); - this.title = mnemonic.getRawLabel(); + mnemonic = new MnemonicString(label); + setTitle(mnemonic.getRawLabel()); assert (mnemonic.getShortcutIdx() >= 0); // Recompute width and height to reflect an empty menu - width = this.title.length() + 4; - height = 2; + setWidth(getTitle().length() + 4); + setHeight(2); - this.active = false; + setActive(false); } }