Window.Title direct assignment not working. (Deleted Issue #58, problem was this issue.)

Issue #73 closed
Winter Laite created an issue

Code throws unhandled exception.

MyGui := Gui()
MyGui.Add("Text", "w400 h10")
MyBtn := MyGui.Add("Button", , "Change Title")
MyBtn.OnEvent("Click", "TrashTitle")
MyGui.Show()


TrashTitle()
{
    MyGui.Title := "My New Title"
}

Working AHK code:

MyGui := Gui()
MyGui.Add("Text", "w400 h10")
MyBtn := MyGui.Add("Button", , "Change Title")
MyBtn.OnEvent("Click", TrashTitle)
MyGui.Show()


TrashTitle(*)
{
    MyGui.Title := "My New Title"
}

Comments (7)

  1. Winter Laite reporter

    This code, when run, does not show the GUI.

    MyGui := Gui()
    MyGui.Add("Text", "w400 h10")
    MyBtn := MyGui.Add("Button", , "Change Title")
    MyGui.Title := "This should work"
    ;MyBtn.OnEvent("Click", TrashTitle)
    MyGui.Show()
    

    It does run correctly, however, in AHK v2.0-beta.7.

  2. Log in to comment