Jump to content
Sign in to follow this  
Topher

Simple mistake I am not seeing

Recommended Posts

Topher

Neither the Close button or closing the gui works

can't see what I am missing.

$StatID = GUICreate("High Scores", 220, 495-30)
...
; wait until window is closed
$close = GUICtrlCreateButton("Close", 220-100, 431, 90, 30)
Do
  $msg = GUIGetMsg()
  If $msg = $close Then ExitLoop
  Sleep(20)
Until $msg = $GUI_EVENT_CLOSE
GUIDelete($StatID)
OnExit()

Routine is at line 828 in whole code

Reflex.au3


[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites
johnynardi

Maybe this will be good for you ?

$StatID = GUICreate("High Scores", 220, 495-30)
GUISetState(@SW_SHOW)
; wait until window is closed
$close = GUICtrlCreateButton("Close", 220-100, 431, 90, 30)
while 1
  $msg = GUIGetMsg()
  If $msg = $close Then ExitLoop
  Sleep(20)
WEnd
GUIDelete($StatID)
OnExit()

Share this post


Link to post
Share on other sites
Topher

Maybe this will be good for you ?

$StatID = GUICreate("High Scores", 220, 495-30)
GUISetState(@SW_SHOW)
; wait until window is closed
$close = GUICtrlCreateButton("Close", 220-100, 431, 90, 30)
while 1
  $msg = GUIGetMsg()
  If $msg = $close Then ExitLoop
  Sleep(20)
WEnd
GUIDelete($StatID)
OnExit()

Sorry, failed to include that when I clipped the middle.

I'm remembering now that I had a problem with StringFormat in this routine earlier. I'm going to write my own stringformat routine and see if that fixes things.


[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites
Topher

Nope, that didn't magically fix things this time.

I'm stumped.


[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

Share this post


Link to post
Share on other sites
AdmiralAlkex

Because you activated OnEvent earlier and you can't mix OnEvent and MessageLoop.

Opt("GUIOnEventMode",1)

Either turn it temporarily off in HighScore() or stick to the same mode throughout your script.

Share this post


Link to post
Share on other sites
Topher

Thank you.

I'm not use to using OnEvent (someone suggested it as a work around on a different problem.)

Easy fix, again thanks - this was driving me nuts.


[left][hr]
$mood = "whimsy"
$mode = "confused"
$randomChaos = True
Do
Something()
Until $Tired
[/left][left]Reflex (Arcade game)[/left][left]IX (Board game)[/left][left]The Word Game (Word game)[/left][left]Plastic Sliding Squares Puzzle (Puzzle)[/left]

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  

×