CatchFish Posted October 5, 2005 Posted October 5, 2005 I need to change the text of a menu item dynamically. But I can't do it with GUICtrlSetData(). [v3.1.1.80] It's possible to change the text by deleting and rebuilding the menu item. But the problem is I need to write much more code to sort the menu items. Is it a better idea changing it directly with GUICtrlSendMsg()? Can anybody show me the code?
CatchFish Posted October 6, 2005 Author Posted October 6, 2005 Thanks a lot, Larry. I'll check it. I still wonder if the GUI menu created by GUICtrlCreateMenuItem() can be handled in the same way...
Holger Posted October 8, 2005 Posted October 8, 2005 @Catchfish: where do you have the problem? Here it works normally (XPSP2): #include <GUIConstants.au3> GUICreate("Test") $menu = GUICtrlCreateMenu ("&File") $item = GUICtrlCreateMenuitem ("Open",$menu) $button = GUICtrlCreateButton ("Check",50,130,70,20) GUISetState () While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE ExitLoop Case $button GUICtrlSetData($menu, "&Files") GUICtrlSetData($item, "Openup") EndSwitch WEnd GUIDelete() Exit Regards 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
CatchFish Posted October 9, 2005 Author Posted October 9, 2005 (edited) Well, I have to recognize that your code works in v3.1.1.81...But I was scripting with v3.1.1.80 when I posted that topic. Same problem in v3.1.1 public release. Most important, everything's okay now...with the help of the new beta release. Thanks, Holger. Edited October 9, 2005 by CatchFish
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