Sign in to follow this  
Followers 0
madasraka

2 GUI's and am getting lost haha

8 posts in this topic

#1 ·  Posted (edited)

Can you guys help me with this code

Click GUI1 and new windows will pop

Without doing anything else click Gui2 and second window will not pop unless button in in previously poped windows is pressed which will delete its own gui and exit the loop.

My question is this.

How (while in one of those 2 loops created by Radio's) read wather or not Main has switched, so that while 1st GUI is showing beign able to switch to second somehow.

Here is the simplest code i could come up with to demonstrate the problem.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("",300,100)
$Gui1Radio = GUICtrlCreateRadio ("Gui1",10,10)
$Gui2Radio = GUICtrlCreateRadio ("Gui21",10,30)
GUISetState(@SW_SHOW)

While 1
   $nMsg = GUIGetMsg()
   Switch $nMsg
       Case $GUI_EVENT_CLOSE
           Exit
       Case $Gui1Radio
           $G1 = GUICreate ("Gui1",200,30)
           $Button1 = GUICtrlCreateButton ("Button 1",0,0)
           GUISetState(@SW_SHOW)
           While 1
              $G1msg = GUIGetMsg()
              Switch $G1msg
                Case $Button1
                    MsgBox(0,'','Button 1 pressed Exitloop')
                    GUIDelete ($G1)
                    ExitLoop
                EndSwitch
            WEnd
        Case $Gui2Radio
            $G2 = GUICreate ("Gui2",200,30)
           $Button2 = GUICtrlCreateButton ("Button 2",0,0)
           GUISetState(@SW_SHOW)
           While 1
              $G2msg = GUIGetMsg()
              Switch $G2msg
                Case $Button2
                    MsgBox(0,'','Button 2 pressed Exitloop')
                    GUIDelete ($G2)
                    ExitLoop
                EndSwitch
            WEnd
   EndSwitch
WEnd
Edited by madasraka

Share this post


Link to post
Share on other sites



You can not include a loop inside a loop. Try creating the new GUIs via calling a function.


[font="Comic Sans MS"]My code does not have bugs! It just develops random features.[/font]My Projects[list][*]Live Streaming (Not my project, but my edited version)[right]AutoIt Wrappers![/right][/list]Pure randomness[list][*]Small Minds.......................................................................................................[size="1"]Simple progress bar that changes direction at either sides.[/size][*]ChristmasIt AutoIt Christmas Theme..........................................................[size="1"]I WAS BOOOORED![/size][*]DriveToy..............................................................................................................[size="1"]Simple joke script. Trick your friends into thinking their computer drive is haywire![/size][/list]In Development[list][*]Your Background Task Organiser[*]AInstall Second Generation[/list]BEFORE POSTING ON THE FORUMS, TRY THIS:
%programfiles%/AutoIt3/autoit3.chm

Share this post


Link to post
Share on other sites

shanet,

You can not include a loop inside a loop

Please do not pass on incorrect information. Of course you can have loops inside loops. And there is no need to use functions here. :x

madasraka,

Take a look at the Managing Multiple GUIs tutorial in the Wiki - it shows you exactly how to do what you want to do by using the "Advanced" parameter with GUIGetMsg. :P

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

You can not include a loop inside a loop. Try creating the new GUIs via calling a function.

From your previous posts I see you are beginner so please stay out instead of making so many shit posts like this one.

I wonder if you only don't want to make bigger post count!   :x

Make posts only when you exactly know what are you talking about!!!

topic reported --> reason: post count hunter

Edited by Zedna

Share this post


Link to post
Share on other sites

OH thanks :shifty:

I didnt know wiki had autoit info about that.

I wonder why forums emoticons have this emoticon. :P Is there linux version of autoit ? I'd love to have that :x

Share this post


Link to post
Share on other sites

OH thanks :shifty:

I didnt know wiki had autoit info about that.

I wonder why forums emoticons have this emoticon. :P Is there linux version of autoit ? I'd love to have that :x

You can run it on Linux through WINE but not everythink is working

I heard that for example HotkeySet doesn't work there..

Share this post


Link to post
Share on other sites

yeah i know that, but it will not effect Linux, its commands or any environmental variables or anything else.

I wish autoit was actually coded their functions for linux specifically so that i could filemove or filecopy in linux as i can in windows but thats not true and i have little to no interested coding anything for linux caz it sucks anyway (after countless attempts of trying do do simple tasks as to backup/restore whole OS so i can restore it if i mess it up while learning, but that only works in windows)

Share this post


Link to post
Share on other sites

Autoit will not be ported to Linux. That was answered many times here.

But There are another similar tools in Linux. I don't use Linux but search web or this forum for more details written earlier.

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