Sign in to follow this  
Followers 0
t0ddie

making a child window

3 posts in this topic

#1 ·  Posted (edited)

i have a gui thats one script, and i want to put that script into another script which is a gui as well, and the second script will open up when you click a button on the first script.

so i was wondering what would be a good way to code this?

because the way i coded it, the parent window closes as well when the close button is clicked on the "child" window, and nothing works on the "parent" window when the second window is open.

i would like to make them both work without using a second script.

i hope this basic question is understandable

Edited by t0ddie

Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

Share this post


Link to post
Share on other sites



#include <GuiConstants.au3>

$main = GUICreate("First GUI", 392, 322)

$Button_1 = GUICtrlCreateButton("Input", 140, 190, 70, 30)

GUISetState()
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $msg = $Button_1
            _SecondGUI()
        Case Else
       ;;;
    EndSelect
WEnd
Exit

Func _SecondGUI()
    $S_GUI = GUICreate("Sencond GUI", 191, 85)
    
    $Input_1 = GUICtrlCreateInput("Input1", 0, 0, 180, 20)
    $Button_2 = GUICtrlCreateButton("OK", 60, 40, 60, 20)
    
    GUISetState()
    While 1
        $msg2 = GUIGetMsg()
        Select
                Case $msg2 = $GUI_EVENT_CLOSE
                    ExitLoop
            Case $msg2 = $Button_2
                ExitLoop
            Case Else
           ;;;
        EndSelect
    WEnd
    GUIDelete($S_GUI)
EndFunc


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

that works better, but heh, i close the first gui when the second one is open, and the second one closes. lol

also, if i click "input" a second time, while the second window is up, it does not make another window. (meaning i think, that the first window isnt accepting input)

i dont really want to make another window, but i was wondering if their was a way to make the first gui able to accept input and function normally while the second window is open.

but this is still alot better than what i had. cool :)


Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.

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