Chained method calls not working

Issue #28 closed
Winter Laite created an issue

The following type of chaining is not working at the moment.

MyGui.Add("Button",, "Exit This Example").OnEvent("Click", "MenuHandler")

The workaround is not difficult, only adds one extra line of code, but does require creating a variable.

MyBtn := MyGui.Add("Button",, "Exit This Example")
MyBtn.OnEvent("Click", "MenuHandler")

Comments (5)

  1. Winter Laite reporter

    Retested with this code:

    MyGui := Gui()
    MyLabel := MyGui.Add("Text", "w200", "Color will appear beow.")
    MyColorText := MyGui.Add("Text", "w200 xp y+10", "")
    MyColorButton := MyGui.Add("Button", "h25 w80 x10 y+10 +Default", "Pixel Color").OnEvent("Click", "GetPix")
    MyGui.Show()
    
    GetPix() {
        MyColorText.Text := PixelGetColor(pos["X"], pos["Y"])
    }
    

  2. Log in to comment