Jump to content

Simple mistake I am not seeing


Recommended Posts

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]
Link to post
Share on other sites

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()
Link to post
Share on other sites

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]
Link to post
Share on other sites

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.

Link to post
Share on other sites

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]
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...