Sign in to follow this  
Followers 0
sandman

This is already not working.. what am I doing wrong?

5 posts in this topic

Okay.. I was about to make a stat calculator script and was in the middle of making the GUI and decided to test it. Everything works fine.. except for two things:

  • It doesn't sleep... at all.
  • It exits the window as soon as it opens it.
Here is the code:

#include <GUIConstants.au3>

$LoaderPopup = GUICreate("",100,100,100,100,$WS_POPUP)
$LoaderProg = GUICtrlCreateProgress(25,45,50,5,$PBS_SMOOTH)
GUISetState(@SW_SHOW)
Sleep(60)
GUICtrlSetData($LoaderProg, 100)
Sleep(60)
Sleep(40)
$MainWin = GUICreate("MYKO Character Rating Calculator",500,500)
$Title = GUICtrlCreateLabel("Basic Calculator", 25, 5, 50, 10)
GUISetState(@SW_SHOW)

What am I doing wrong? :)


[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Share this post


Link to post
Share on other sites



Sleep(1000) = sleep 1 second

try sleep(2000) or (3000)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Oh.. hehe.

Thanks!


[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Share this post


Link to post
Share on other sites

Okay, that works now.. but as soon as the new main window shows up it stays for about a millisecond and then disappears.


[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Share this post


Link to post
Share on other sites

[*]It exits the window as soon as it opens it.

You should add the "while" loop for the GUI as below.

#include <GUIConstants.au3>

GUICreate("My GUI")  ; will create a dialog box that when displayed is centered
GUISetState (@SW_SHOW)       ; will display an empty dialog box

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

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  
Followers 0