Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: Loulou 54 on August 24, 2011, 12:41:29 pm

Title: toolpalette => ??
Post by: Loulou 54 on August 24, 2011, 12:41:29 pm
How to use toolpalette's functions ??

I've tried this and it doesn't work.. I have the error "expected function in menu item 1 of tool box 1"
Code: [Select]
menu = {
 
    {"Mode",                          -- Tool box "Mode"
       {"Decimal", setDec},           -- Menu item "Decimal" calls function setDec()
       {"Hexadecimal", setHex},
       {"Octal", setOct},
       {"Binary", setBin}
    }
}
 
toolpalette.register(menu)

function setDec()

end

function setHex()

end

function setOct()

end

function setBin()

end

Thank you. :)
Title: Re: toolpalette => ??
Post by: Jim Bauwens on August 24, 2011, 01:05:40 pm
Try putting the functions (setDec, setOct) before the table. Now when you define the table they are nil, so the value is nil instead of a function ;)
Title: Re: toolpalette => ??
Post by: Loulou 54 on August 24, 2011, 04:08:42 pm
OMG you're right..
I've already tried that before but I may have forgotten something.. I don't know. ^^'

Well it's ok now. Thank you Jim. :)
Title: Re: toolpalette => ??
Post by: Adriweb on August 24, 2011, 04:13:56 pm
We might want to clear that up just as a remainder, in the Inpsired-Lua wiki about that one....
Title: Re: toolpalette => ??
Post by: Loulou 54 on August 24, 2011, 04:25:47 pm
And it would be fine to say that it is activated by pressing menu key ! I thought at the begining it was a PopUp menu that you can launch with a function.. :)
Title: Re: toolpalette => ??
Post by: Adriweb on August 25, 2011, 07:54:39 am
And the software creates a specific panel of your toolpalette inside the sidebar with all the other software functions :)
Title: Re: toolpalette => ??
Post by: Jim Bauwens on August 25, 2011, 08:48:06 am
I'll try to edit the toolpalette page later today (and I will try to edit other stuff).
Title: Re: toolpalette => ??
Post by: Adriweb on August 25, 2011, 01:01:05 pm
cool thanks ;)