AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DeleteAll in Gui Submenus

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports
View previous topic :: View next topic  
Author Message
Landvermesser



Joined: 03 Nov 2004
Posts: 51

PostPosted: Sun Mar 06, 2005 3:12 pm    Post subject: DeleteAll in Gui Submenus Reply with quote

DeleteAll does not work and all following lines do not work too:

Code:

Menu, Submenu, Add, Testitem, Label
Menu, DropDownMenu, Add, TestSubmenu, :Submenu
Menu, MainMenu, Add, File, :DropDownMenu
Gui, Menu, MainMenu
Gui, Show, Center w200 h100, Test

Menu, Submenu, DeleteAll
Menu, Submenu, Add, NewTestItem, Label

Label:
Return


Is it a bug?
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Sun Mar 06, 2005 11:39 pm    Post subject: Reply with quote

Short answer: To solve this issue, detach the menu bar with "Gui Menu" prior to doing DeleteAll, then reattach it afterward with "Gui Menu, MainMenu".

Long answer:
There were two problems with the program:
1) No error message was displayed to indicate the failure of DeleteAll.
2) The documentation was wrong because it says you can use DeleteAll on a menu bar's submenus, which isn't always the case.

Both of these problems will be fixed in the next update, so thanks for reporting it. The updated documentation is:
Quote:
The use of certain destructive menu sub-commands such as Delete and DeleteAll against a menu that is currently being used as a menu bar (and in some cases, its submenus) is not supported and will cause an error dialog to be displayed (unless the UseErrorLevel setting is in effect). Use the following steps to make such changes: 1) detach the menu bar with "Gui Menu"; 2) make the changes; 3) reattach the menu bar with "Gui Menu, MyMenuBar".
Back to top
View user's profile Send private message Send e-mail
Landvermesser



Joined: 03 Nov 2004
Posts: 51

PostPosted: Mon Mar 07, 2005 8:21 am    Post subject: Reply with quote

Thanks, Chris!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Bug Reports All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group