Jump to content
Sign in to follow this  
RandomGuest

Two questions...

Recommended Posts

RandomGuest

How can I make so when I push a button the script will open a window, and now the script randomly chooses from 100 different texts, and shows the text in a new window.

And I got this window, when I push the Options button a new window opens and then I push another button on the option winow to open a new window.

Now when I push the exit button on the newest window the window closes down, but when I push the exit button on the Options window nothing happens, does it have anything to with ExitLoop?

Thanks =))

( I have checked the help files but I am noob so I may need some help out of you guys :) )

Share this post


Link to post
Share on other sites
RandomGuest

show your code to get the best help

8)

I cutted some things out, but it should be cool anyway, well heres the script:

#include <GUIConstants.au3>

$hGUI = GUICreate ("Test", 900, 700,)

Opt("GUICoordMode",5)

$button_3 = GUICtrlCreateButton ("Options", 165, 30, 60)

$button22 = GUICtrlCreateButton("Exit",285,495,325,100)

GUISetState ()

While 1

$msg = GUIGetMsg()

Switch $msg

Case $GUI_EVENT_CLOSE

ExitLoop

Case $button_3

make2()

Case $button22

Exit

EndSwitch

Wend

Func Make2()

GUICreate("Window 2", 600, 550,)

$button21 = GUICtrlCreateButton("Exit",135,420,325,100)

$button_4 = GUICtrlCreateButton ("Window 3", 105, 30, 60)

GUISetState()

While 1

$msg2 = GUIGetMsg()

Switch $msg2

Case $GUI_EVENT_CLOSE

ExitLoop

Case $button_4

make3()

Case $button21

ExitLoop

EndSwitch

WEnd

GUIDelete("Options")

EndFunc

Func Make3()

GUICreate("Window 3", 600, 550,)

$button20 = GUICtrlCreateButton("Exit",135,420,325,100)

GUISetState()

While 1

$msg2 = GUIGetMsg()

Switch $msg2

Case $GUI_EVENT_CLOSE

ExitLoop

Case $button20

ExitLoop

EndSwitch

WEnd

GUIDelete("Options")

EndFunc

Share this post


Link to post
Share on other sites
Paulie

#include <GUIConstants.au3>
Opt("GUICoordMode", 5)


$GUI = GUICreate("Test", 900, 700)
$button_3 = GUICtrlCreateButton("Options", 165, 30, 60)
$button22 = GUICtrlCreateButton("Exit", 285, 495, 325, 100)
GUISetState()

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            ExitLoop
        Case $button_3
            Make2()
        Case $button22
            Exit
    EndSwitch
WEnd

Func Make2()
    $GUI2=GUICreate("Window 2", 600, 550)
    $button21 = GUICtrlCreateButton("Exit", 135, 420, 325, 100)
    $button_4 = GUICtrlCreateButton("Window 3", 105, 30, 60)
    GUISetState()
    While 1
        $msg2 = GUIGetMsg()
        Switch $msg2
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $button_4
                Make3()
            Case $button21
                ExitLoop
        EndSwitch
    WEnd
    GUIDelete($GUI2)
EndFunc   ;==>Make2
Func Make3()
    $GUI3=GUICreate("Window 3", 600, 550)
    $button20 = GUICtrlCreateButton("Exit", 135, 420, 325, 100)
    GUISetState()
    While 1
        $msg2 = GUIGetMsg()
        Switch $msg2
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $button20
                ExitLoop
        EndSwitch
    WEnd
    GUIDelete($GUI3)
EndFunc   ;==>Make3

Seems to work how I expected it to... Main problem was you GUIDeletes.

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  

×