Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gui created in Func should be global #300

Open
Banaanae opened this issue Oct 3, 2024 · 0 comments
Open

Gui created in Func should be global #300

Banaanae opened this issue Oct 3, 2024 · 0 comments

Comments

@Banaanae
Copy link
Collaborator

Banaanae commented Oct 3, 2024

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 myGui ; V1toV2: Made function global
   myGui := Gui()
   myGui.Add("Text", , "Gui")
   myGui.Show("w150")
}
MyFunc()

F1::myGui.Destroy()

Same should apply to menu (untested)

Banaanae added a commit that referenced this issue Oct 3, 2024
added f tests for #294 #295 #296 #298 #299 #300 #301
cleanup return tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant