Page 1 of 1
Tray submenu , need some help
Posted: 05 Dec 2022, 01:07
by armin889
Hi autohotkey-community
I want to make a Tray menu with submenu
in the code, this part is not working
Code: Select all
FoodOfferedSubmenuID:
MsgBox, Food
return
Anyone knows how to make it work?
Code: Select all
#Persistent
Menu, FoodOfferedSubmenuID, add, Text which says Pizza, PizzaSubroutine
Menu, FoodOfferedSubmenuID, add, Text which says Spaghetti, SpaghettiSubroutine
Menu, Tray, add, Text which says Food offered, :FoodOfferedSubmenuID
return
PizzaSubroutine:
MsgBox, pizza
return
SpaghettiSubroutine:
MsgBox, spaghetti
return
FoodOfferedSubmenuID:
MsgBox, Food
return
Re: Tray submenu , need some help
Posted: 05 Dec 2022, 07:04
by mikeyww
Code: Select all
#Persistent
; Submenu
Menu, FoodOfferedSubmenuID, Add, Text which says Pizza , PizzaSubroutine
Menu, FoodOfferedSubmenuID, Add, Text which says Spaghetti, SpaghettiSubroutine
Menu, FoodOfferedSubmenuID, Add, Text which says Food , FoodOfferedSubmenuID
; Main menu
Menu, Tray, Add, Text which says Food offered , :FoodOfferedSubmenuID
Return
PizzaSubroutine:
MsgBox, pizza
Return
SpaghettiSubroutine:
MsgBox, spaghetti
Return
FoodOfferedSubmenuID:
MsgBox, Food
Return
Re: Tray submenu , need some help
Posted: 05 Dec 2022, 08:06
by armin889
Thanks, but I want Food not in submenu I want click on the mainmenu Food, and it should open Msgbox Food
Re: Tray submenu , need some help
Posted: 05 Dec 2022, 08:30
by mikeyww
As you can see, you have a choice of whether your items appear in the main menu or a submenu. You can put your items where you like.
Code: Select all
#Persistent
; Submenu
Menu, sub, Add, Pizza
Menu, sub, Add, Spaghetti
; Main menu
Menu, Tray, Add, Food
Menu, Tray, Add, Specific foods, :sub
Return
Pizza:
MsgBox, Pizza
Return
Spaghetti:
MsgBox, Spaghetti
Return
Food:
MsgBox, Food
Return
Re: Tray submenu , need some help
Posted: 05 Dec 2022, 09:26
by armin889
Yes i have understood this, but it's not what I need
I want that this line
Menu, Tray, Add, Specific foods, :sub
open submenu by mouseover and doing "food:" on clicking on it
if I click now on it, nothing happen
- SciTE_T53Jqsbdpe.jpg (29.93 KiB) Viewed 392 times
Re: Tray submenu , need some help
Posted: 05 Dec 2022, 09:52
by mikeyww
There is no magic here. You are able to move the menus to where you would like them to be.
Code: Select all
#Persistent
; Submenu
Menu, sub, Add, Pizza
Menu, sub, Add, Spaghetti
Menu, sub, Add, Food
; Main menu
Menu, Tray, Add, Specific foods, :sub
Return
Pizza:
MsgBox, Pizza
Return
Spaghetti:
MsgBox, Spaghetti
Return
Food:
MsgBox, Food
Return
Re: Tray submenu , need some help
Posted: 05 Dec 2022, 10:11
by armin889
Well I guess I am bad in explaining, so I try it with picture
- mspaint_pPBYsKFa6r.jpg (24.91 KiB) Viewed 373 times
I want to click on "Specific foods" and it should do something
in your script, click on "Specific foods" does nothing
Re: Tray submenu , need some help
Posted: 05 Dec 2022, 10:13
by mikeyww
The AutoHotkey menu does not work in that way, as far as I know-- you pick whether you want to execute a subroutine
or open a submenu-- but you could create a GUI that does what you have described. The forum might also have some "extended menu" scripts, perhaps worth a search. There are some other posts with "menu tricks", so they might be informative. Ideas:
viewtopic.php?t=102466.
Re: Tray submenu , need some help
Posted: 05 Dec 2022, 10:35
by armin889
I have already searched in google and here in board but not found a solution that worked
Re: Tray submenu , need some help
Posted: 05 Dec 2022, 10:44
by mikeyww
You can grow your own! GUI is versatile.