View Single Post
Old 06-21-2019, 12:49 AM   #506
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 1,074
Default

I'm trying to replace a Radio with a Menubox.
I don't know if I have to change the "optarray" to something else as it gets

Error: Class - Menubox.lua:141: bad argument #1 to 'floor' (number expected, got nil)


when I select a Radio it updates the buttons.

Code:
    --GUI.New("scale_choice",     "Radio",          4, 20, 100, 140, 330, "Select Scale", "Major,Minor,Harmonic Major,Harmonic Minor", "v", 4)
    
    GUI.New("scale_choice",   "Menubox",     4, 120, 100, 64, 20, "Select Scale", "Major,Minor,Harmonic Major,Harmonic Minor")
    
    scale = GUI.elms.scale_choice.optarray[ GUI.Val("scale_choice") ]

function GUI.elms.scale_choice:onmouseup()
    -- Run the original method
    GUI.Radio.onmouseup(self)

    -- And then your function
    update_chord_buttons() 
end

    scale_numbers = GUI.Val("scale_choice")
    scale_names = { [1] = "Major", [2] = "Minor", [3] = "Harmonic_Major", [4] = "Harmonic_Minor"}
    selected_scale = scale_names[scale_numbers]
I'm always trying to find this you should put it in you signature
https://github.com/jalovatt/Lokasenna_GUI/wiki




.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
MusoBob is offline   Reply With Quote