mcclane654 Posted November 8, 2013 Share Posted November 8, 2013 expandcollapse popup#include <GUIConstantsEx.au3> #include <ButtonConstants.au3> Global $enableinput2 = 1 Global $meldinger = 1 Func Menu() GUICreate ("", 500, 200) GUISetState() $messagesmenu = GUICtrlCreateMenu("Messages") $optionsmenu = GUICtrlCreateMenu("Options") $defaultsettings = GUICtrlCreateMenuItem("Default settings", $messagesmenu,"",1) GUICtrlSetState(-1, $GUI_CHECKED) $Customsettings = GUICtrlCreateMenuItem("Custom settings", $messagesmenu,"",1) $Enteratstart = GUICtrlCreateMenuItem("Enter at start", $messagesmenu,"",1) $Options = GUICtrlCreateMenuItem("Options", $optionsmenu) $button = GUICtrlCreateButton("Press to start", 200, 70, 100, 40) Global $s While $s = 0 Local $msg = GUIGetMsg(1) Switch $msg[0] Case $button Start() Case $GUI_EVENT_CLOSE Exit("0") Case $defaultsettings Start2() Case $Customsettings MsgBox(64, "under construction", "coming soon") Case $Enteratstart MsgBox(64, "under construction", "coming soon") Case $Options $s=1 options() EndSwitch WEnd EndFunc Func Options() GUICreate("Options", 350, 500) GUISetState() GUICtrlCreateLabel("How many different messages?", 5,30) GUICtrlCreateInput("", 5, 50) GUICtrlCreateLabel("What should messages say?", 5,70) Local $melding[1] $melding[0] = GUICtrlCreateInput ("", 5,20*0+90) GUICtrlCreateLabel("How many messages?", 5,20*0+110) Global $antallmeldinger = GUICtrlCreateInput ("", 5,20*0+130) $okbutton = GUICtrlCreateButton("Ok", 100, 450, 50, 30) $closebutton = GUICtrlCreateButton("Close", 200, 450, 50, 30) $msg1 = GUIGetMsg() While 1 Switch $msg1 Case $closebutton MsgBox(64,"button test", "it works") Case $okbutton MsgBox(64,"button test", "it works") Case $GUI_EVENT_CLOSE MsgBox(64,"button test", "it works") EndSwitch WEnd EndFunc can any1 help mee find out why my buttons and close button dosen't respond in the second window Options() ? Link to comment Share on other sites More sharing options...
kylomas Posted November 8, 2013 Share Posted November 8, 2013 mcclane654, Two things: 1 - functions start() and start2() are missing 2 - You don't actually execute anything. You only have functions in your script. kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
mcclane654 Posted November 8, 2013 Author Share Posted November 8, 2013 (edited) This isen't the whole script! This is the part that i struggle with. So if you could help me make the msgbox pop up when the button is pressed i'll handle the rest myself Edited November 8, 2013 by mcclane654 Link to comment Share on other sites More sharing options...
kylomas Posted November 8, 2013 Share Posted November 8, 2013 Put your guigetmsg() inside the while loop. Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
mcclane654 Posted November 8, 2013 Author Share Posted November 8, 2013 Can't belive i missed it thx Link to comment Share on other sites More sharing options...
mcclane654 Posted November 8, 2013 Author Share Posted November 8, 2013 now the buttons work but have can I fix it soo that when you press close it only closes the option gui :S? I have tried: WinKill("Options") WinClose("Options") Exit("0") but when i press the buttons afterward they quit the whole script help? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 8, 2013 Moderators Share Posted November 8, 2013 mcclane654,I recommend reading the Managing Multiple GUIs tutorial in the Wiki. 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...
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