Created
September 7, 2018 11:21
-
-
Save lukpazera/8676cf6782307b619d8c902f9bcf26ce to your computer and use it in GitHub Desktop.
This command shows how to set up text hints for an integer command argument in python. Courtesy of James O'Hare.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#python | |
import lx | |
import lxu.command | |
my_hint = ( (0, 'zero' ), | |
(1, 'one' ), | |
(-1, 'minusone' ),) | |
class TextValueHint_Cmd(lxu.command.BasicCommand): | |
def __init__(self): | |
lxu.command.BasicCommand.__init__(self) | |
self.dyna_Add("myArg", lx.symbol.sTYPE_INTEGER) | |
self.dyna_SetHint(0, my_hint) | |
def cmd_ArgType(self,index): | |
pass | |
def basic_Execute(self, msg, flags): | |
my_val = self.dyna_Int(0, -1) | |
print my_val | |
lx.bless(TextValueHint_Cmd, 'ffr.textValueHint') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment