madasraka Posted December 30, 2010 Share Posted December 30, 2010 (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. expandcollapse popup#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 December 30, 2010 by madasraka Link to comment Share on other sites More sharing options...
shanet Posted December 30, 2010 Share Posted December 30, 2010 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 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 30, 2010 Moderators Share Posted December 30, 2010 shanet,You can not include a loop inside a loopPlease do not pass on incorrect information. Of course you can have loops inside loops. And there is no need to use functions here. 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. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Zedna Posted December 30, 2010 Share Posted December 30, 2010 (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! Make posts only when you exactly know what are you talking about!!!topic reported --> reason: post count hunter Edited December 30, 2010 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
madasraka Posted December 31, 2010 Author Share Posted December 31, 2010 OH thanks I didnt know wiki had autoit info about that. I wonder why forums emoticons have this emoticon. Is there linux version of autoit ? I'd love to have that Link to comment Share on other sites More sharing options...
Zedna Posted December 31, 2010 Share Posted December 31, 2010 OH thanks I didnt know wiki had autoit info about that.I wonder why forums emoticons have this emoticon. Is there linux version of autoit ? I'd love to have that You can run it on Linux through WINE but not everythink is workingI heard that for example HotkeySet doesn't work there.. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
madasraka Posted January 3, 2011 Author Share Posted January 3, 2011 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) Link to comment Share on other sites More sharing options...
Zedna Posted January 5, 2011 Share Posted January 5, 2011 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. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now