X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTButton.java;h=d1d7b390cca0170e0c33f9cde044e968c64fc947;hb=HEAD;hp=3938c737aff1f18036e17fd7ad93e307c9984a3f;hpb=d8dc8aea32a07a0653933700f1abadc7776b013f;p=fanfix.git diff --git a/src/jexer/TButton.java b/src/jexer/TButton.java index 3938c73..d1d7b39 100644 --- a/src/jexer/TButton.java +++ b/src/jexer/TButton.java @@ -129,6 +129,20 @@ public class TButton extends TWidget { this(parent, text, x, y); this.action = action; } + + /** + * The action to call when the button is pressed. + **/ + public TAction getAction() { + return action; + } + + /** + * The action to call when the button is pressed. + **/ + public void setAction(TAction action) { + this.action = action; + } // ------------------------------------------------------------------------ // Event handlers --------------------------------------------------------- @@ -308,7 +322,7 @@ public class TButton extends TWidget { */ public void dispatch() { if (action != null) { - action.DO(); + action.DO(this); inButtonPress = false; } }