AHK-v2-script-converter icon indicating copy to clipboard operation
AHK-v2-script-converter copied to clipboard

Gui created in Func should be global

Open Banaanae opened this issue 4 months ago • 0 comments

V1:

MyFunc() {
   Gui, Add, Text,, Gui
   Gui, Show, w150
}
MyFunc()

F1::Gui, Destroy

V2 (Converted):

MyFunc() {
   myGui := Gui()
   myGui.Add("Text", , "Gui")
   myGui.Show("w150")
}
MyFunc()

F1::myGui.Destroy()

V2 (Expected):

MyFunc() {
   global ; V1toV2: Made function global
   myGui := Gui()
   myGui.Add("Text", , "Gui")
   myGui.Show("w150")
}
MyFunc()

F1::myGui.Destroy()

Same should apply to menu (untested)

Banaanae avatar Oct 03 '24 07:10 Banaanae