alawoona Posted September 26, 2004 Posted September 26, 2004 (edited) What am i doing wrong - When I enter <ALT>f the file menu does not open? Tried the example in the help file and it seems to work. #include "GUIConstants.au3" GUICreate("My GUI menu",300,200) $oFileMenu = GUICtrlCreateMenu ("&File") $oFileNew = GUICtrlCreateMenuItem ( "&New", $oFileMenu ) $oFileOpen = GUICtrlCreateMenuItem ("&Open",$oFileMenu) $oRecentFilesMenu = GUICtrlCreateMenu ("Recent Files",$oFileMenu,2) $oSeparator1 = GUICtrlCreateMenuitem ("",$oFileMenu,3) $oSaveFile = GUICtrlCreateMenuitem ("&Save", $oFileMenu) GUICtrlSetState($oSaveFile,$GUI_DISABLE) $oSaveFileAs = GUICtrlCreateMenuitem ("Save &As...", $oFileMenu) GUICtrlSetState($oSaveFileAs,$GUI_DISABLE) $oSeparator2 = GUICtrlCreateMenuitem ("",$oFileMenu,6) $oClose = GUICtrlCreateMenuitem ("&Close", $oFileMenu) $oEditMenu = GUICtrlCreateMenu ( "&Edit" ) GUISetState () While 1 $msg = GUIGetMsg() If $msg = $oFileOpen Then $file = FileOpenDialog("Choose file...",@TempDir,"All (*.*)") EndIf If $msg = $oClose Then GUIDelete() Exit EndIf WEnd GUIDelete() Exit Edited September 26, 2004 by alawoona
CyberSlug Posted September 27, 2004 Posted September 27, 2004 If you add the following two lines to the start of your script, the problem goes away:$okbutton = GUICtrlCreateButton ("OK",50,130,70,20) GUICtrlSetState(-1,$GUI_FOCUS) So why does the $GUI_FOCUS affect the Alt keys? Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Holger Posted September 28, 2004 Posted September 28, 2004 Will take a look at later. @CyberSlug: you don't need this. Something like: GUICtrlCreateLabel("",1,1) will also solve temporarly the problem... Hmm.... Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
Holger Posted September 28, 2004 Posted September 28, 2004 (edited) UpdateSeems to be a general problem with a menu- and 'controlfree'-window.I used some other sample menu applications and removed the controls from the windows -> and now they have the same problem.So I see no chance to correct a default-will-ever-happens-bug P.S.: I never saw an application with only menus in it but however, you could use the small workaround with creating a small label.I somebody knows a solution let us know So long and regardsHolger Edited September 28, 2004 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
alawoona Posted September 29, 2004 Author Posted September 29, 2004 Thanx Holger - there will be other controls in my GUI so that will overcome the "problem"
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