Jump to content

2 GUI's in a script


 Share

Recommended Posts

Hi,

In my script I made a first GUI with OnEvent mode; then if a button is pressed a function is called and a second GUI window appears, the function ends.

Problem: when I try to close the second GUI window, it doesn't work! I have to close the first window to terminate the script, but it isn't that I want.

Someone could help me, please?

P.S.: $GUI_EVENT_CLOSE is set as GuiSetOnEvent, with function to end the script.

Link to comment
Share on other sites

Hi,

In my script I made a first GUI with OnEvent mode; then if a button is pressed a function is called and a second GUI window appears, the function ends.

Problem: when I try to close the second GUI window, it doesn't work! I have to close the first window to terminate the script, but it isn't that I want.

Someone could help me, please?

P.S.: $GUI_EVENT_CLOSE is set as GuiSetOnEvent, with function to end the script.

GUISetOnEvent($GUI_EVENT_CLOSE, "GuiCloseClick")

Func GuiCloseClick()
    If @GUI_WINHANDLE = $Gui_Help_About Then 
        GUISetState(@SW_HIDE, $Gui_Help_About)
    EndIf
    If @GUI_WINHANDLE = $gui_Main Then 
        Exit
    EndIf
EndFunc

etc :whistle: You should get the idea ;)

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

Or use GuiDelete and GuiSwitch rather than @SW_HIDE. With @SW_HIDE your window will continue to consume resources.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...