WoodGrain Posted April 14, 2005 Share Posted April 14, 2005 Hi guys, Could someone please give me a head start with creating a GUI? For my current project I want to prompt the user with a Message type box with a title, description/question & 2 buttons with the button text "Big" and "Small" and the resulting code execution based on which button they press. That'd be a big help - thanks guys. Link to comment Share on other sites More sharing options...
sandyd Posted April 14, 2005 Share Posted April 14, 2005 Have a look in the HELP file. Its all there. ----[ SandyD ]--- Link to comment Share on other sites More sharing options...
GaryFrost Posted April 14, 2005 Share Posted April 14, 2005 you might want to look at the SciTE editorSciTE SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
buzz44 Posted April 14, 2005 Share Posted April 14, 2005 #include <GUIConstants.au3> GUICreate ( "Insert title Here...", 266,91) GUICtrlCreateLabel ( "Insert question here...", 20, 10, 200, 20) $Big = GUICtrlCreateButton ( "Big", 20, 50, 100) $Small = GUICtrlCreateButton ( "Small", 146, 50, 100) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Big ;Insert Code Here Case $msg = $Small ;Insert Code Here EndSelect Wend That will get you started. Because you wanted custom text on the button we couldnt just use a simple Msgbox() Function as the buttons can only contain set text such as "Yes", "No", "Retry" etc. Instead I had to create a custom GUI window that looks like a message box. qq Link to comment Share on other sites More sharing options...
WoodGrain Posted April 15, 2005 Author Share Posted April 15, 2005 Thanks for that.It's just the kick start I needed to start getting my head around it (as i've only created GUIs visually before).#include <GUIConstants.au3> GUICreate ( "Insert title Here...", 266,91) GUICtrlCreateLabel ( "Insert question here...", 20, 10, 200, 20) $Big = GUICtrlCreateButton ( "Big", 20, 50, 100) $Small = GUICtrlCreateButton ( "Small", 146, 50, 100) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Big ;Insert Code Here Case $msg = $Small ;Insert Code Here EndSelect WendThat will get you started. Because you wanted custom text on the button we couldnt just use a simple Msgbox() Function as the buttons can only contain set text such as "Yes", "No", "Retry" etc. Instead I had to create a custom GUI window that looks like a message box.<{POST_SNAPBACK}> Link to comment Share on other sites More sharing options...
WoodGrain Posted April 15, 2005 Author Share Posted April 15, 2005 What a great editor - thanks for pointing me to it.I'd been using Crimson Editor until now..you might want to look at the SciTE editorSciTE<{POST_SNAPBACK}> 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