View Single Post
Old 11-15-2018, 12:49 PM   #361
dsyrock
Human being with feelings
 
dsyrock's Avatar
 
Join Date: Sep 2018
Location: China
Posts: 565
Default

Quote:
Originally Posted by Lokasenna View Post
Did you remember to include a call to the original methods inside both of yours? If you forget that, then the element literally doesn't know anymore what it's supposed to be doing.
I'm not sure, are these right? I just copy from where I declared them the first time. And "onmousedown" still worked but "ondrag" didn't

PS:I said the ondrag thing did not work, it meaned the slider was not only failed to run functionB, but also failed to drag the slider’s handle

Code:
function functionB()

 some codes

end

function functionA()

  some codes

    GUI.New("mylider", "Slider", {     --recreate the slider
        z = 11,
        x = 1096.0,
        y = 5.0,
        w = 106,
        min=0,
        max=newvalue,                  -- new value of max
        defaults=0,    
        caption = "myslider",
        font = 3,
        col_txt = "txt",
        --col_fill = "elm_frame",
        show_values=false
       
    })    

    function GUI.elms.myslider:onmousedown()      --have to declare it again

     GUI.Slider.onmousedown(self)
   
      funntionB()
      
    end
    
    function GUI.elms.myslider:ondrag()           --have to declare it again

      GUI.Slider.ondrag(self)

      functionB()

    end

  reaper.defer(functionA)

end

Last edited by dsyrock; 11-15-2018 at 06:19 PM.
dsyrock is offline   Reply With Quote