Jump to content
Sign in to follow this  
Donald8282

GUI not working properly

Recommended Posts

Donald8282

Hello, I have a main gui window and a pop up one but still a "GUICreate". For some reason when I have the pop up window out and I press the close button on the main GUI window it closes the pop up. What can I do to solve this?

Main Window Control

func _main()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        case $msg = $name
            _username()
                        GuiCtrlSetState($maingui ,$GUI_DISABLE)
        case $msg = $quit
            $quitmsg = MsgBox(8484, "Quit?", "Are you sure you want to quit?")
            if $quitmsg = 6 Then
                Exit
            
            EndIf
    EndSelect
WEnd
EndFunc

Pop up Control

While 1
    $msg1 = GUIGetMsg()
    Select
    Case $msg1 = $GUI_EVENT_CLOSE
            GUIDelete($usernamegui)
            _main()
            GuiCtrlSetState($maingui ,$GUI_ENABLE)
    EndSelect
WEnd

If someone could tell me how to make it so my main control is not part of the pop up control or make the main control unavailable while the pop up is up i wold be so grateful. Thanks in advance.

Edited by Donald8282

Share this post


Link to post
Share on other sites
jchd

How can you have _two_ separate infinite loops running simultaneously?


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites
Donald8282

How can you have _two_ separate infinite loops running simultaneously?

They aren't. When you press a button it stops the _main() func and starts the other func.

Share this post


Link to post
Share on other sites
jchd

It's even worse: when you're in the pop-up loop and get to the close message, you delete the user gui and _run_ the main loop, which becomes a loop in the loop. Then I suspect that the function _username() _runs_ yet another instance of the user loop, which makes a loop in the loop in the loop. You're going to recurse until out of stack space this way.

Merge both loops into one and you're going to save you endless headaches.


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.