Skip to content

Instantly share code, notes, and snippets.

@lukpazera
Created September 7, 2018 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukpazera/8676cf6782307b619d8c902f9bcf26ce to your computer and use it in GitHub Desktop.
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.
#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