You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am fairly certain the syntax for destroying the gui on the press of the escape key is correct here, but it does not work. The form is properly destroyed when pressing the close button top right. Am I missing something here or is this a bug?
; Include the Neutron library
#Include ./libs/Neutron.ahk
MADRS(){
; Create a new NeutronWindow
Madrs := new NeutronWindow()
Madrs.Load("madrs-neutron.html")
Madrs.Gui("+LabelNeutron")
; Show the GUI
Madrs.Show("w1200 h1200 x2500 y500")
; Set focus to the form
Madrs.doc.focus()
WinActivate, % "madrs-neutron.ahk" Madrs.hWnd
return
MadrsEscape:
MsgBox, "escape pressed" ;this does not show
Madrs.Destroy() ;this does not destroy the gui
Return
MadrsClose:
Madrs.Destroy()
Return
}
Huge thanks for your work!!
The text was updated successfully, but these errors were encountered:
The form is properly destroyed when pressing the close button top right
That's because the close button is calling the neutron.Close() function which is set as its onclick in the examples.
This should fix it :D
; Include the Neutron library#Include./libs/Neutron.ahkMADRS(){
; Create a new NeutronWindowglobal Madrs := new NeutronWindow() ; <---- the window object should be global, if you want to access it in the labels
Madrs.Load("madrs-neutron.html")
; Madrs.Gui("+LabelNeutron") ; <---- this should match the prefix you're using in the 'Close' and 'Escape' labels
Madrs.Gui("+LabelMadrs") ; like this ; Show the GUI
Madrs.Show("w1200 h1200 x2500 y500")
; Set focus to the form
Madrs.doc.focus()
WinActivate, % "madrs-neutron.ahk" Madrs.hWnd
returnMadrsEscape:
MsgBox, "escape pressed" ;this does not show
Madrs.Destroy() ;this does not destroy the guiReturnMadrsClose:
Madrs.Destroy()
Return
}
I am fairly certain the syntax for destroying the gui on the press of the escape key is correct here, but it does not work. The form is properly destroyed when pressing the close button top right. Am I missing something here or is this a bug?
Huge thanks for your work!!
The text was updated successfully, but these errors were encountered: