Jump to content

GUI / 2nd GUI interruptions


sulfurious
 Share

Recommended Posts

I have not found the thread for this, if it exists.

I have a GUI. Some buttons. Press a button, and some parsing starts to happen. At some point in the parsing, I can msgbox a choice to do something with a particular line of parse.

To give it more options, I made a 2nd GUI, hidden at inception. Now, when I am in a for next loop, and I come across this decision spot, how do I call the 2nd GUI into play. I am using OnEvent mode. If I call a function to show the 2nd GUI, I need that function to stay open and not return. So I use a While loop. But, that effectively kills any button clicking on the 2nd GUI.

Or, I just show the 2nd GUI from the decision spot, but once again, I need to leave that routine and go into another. The only way I know of to stop the current loop and go into another is make it idle there. With some kind of a loop.

I think the function call holds the most promise. I made the 2nd GUI create in a function, but it still accepts no user action.

How can this be achieved?

late,

Sul

Link to comment
Share on other sites

  • 1 year later...

Without seeing any of your code, this is what i can suggest:

Before the For Next loop, disable OnEventMode and create the GUI with the controls and such.

Then when the gui is needed within the For Next loop, "call it into play" but showing it (duh :)) and have a While Wend loop within your for next loop to handle anything like that.

E.g.

$Opt = Opt("GUIOnEventMode", 0)
;Create GUI and controls here
For $i = 1 To $Var
    ; do your stuff here
    If $Somethinghappened Then
        GUISetState(@SW_SHOW)
        While 1
            $Msg = GUIGetMsg()
            Switch $Msg
                Case $A_Button
                    ;do stuff
                Case $Another_Button
                    ;do stuff
                Case -3 ;close button
                    ExitLoop
            EndSwitch
        WEnd
    EndIf
    
    ;continue doing stuff if needed
Next
Opt("GUIOnEventMode", $Opt)

That *should* work, didn't test it though >_<

*EDIT* Didn't see this was 2 years old, hope it can still help though :idiot:

Edited by SxyfrG

My scripts:AppLauncherTRAY - Awesome app launcher that runs from the system tray NEW VERSION! | Run Length Encoding - VERY simple compression in pure autoit | Simple Minesweeper Game - Fun little game :)My website

Link to comment
Share on other sites

  • 3 weeks later...

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...