$menuicon » History » Version 7
Per Amundsen, 02/23/2023 05:08 PM
1 | 1 | Per Amundsen | _Added in 2.7_ |
---|---|---|---|
2 | |||
3 | 4 | Per Amundsen | *$menuicon(filename,[index])* |
4 | 1 | Per Amundsen | |
5 | Adds a icon to a [[Scripting Menus|menu item]]. |
||
6 | |||
7 | 3 | Per Amundsen | _Since ":" characters are not allowed in the menu text, [[$chr|$chr(58)]] can be used if a X:\ path is used._ |
8 | 2 | Per Amundsen | |
9 | 7 | Per Amundsen | _See also [[$menu]], [[$menutype]], [[$menucontext]], [[$mouse]], [[Scripting_Menus|Menus]]._ |
10 | |||
11 | 1 | Per Amundsen | *Parameters* |
12 | |||
13 | 5 | Per Amundsen | table(ktable). |
14 | |*Parameter*|*Description*| |
||
15 | | filename | Path to the icon/image file. | |
||
16 | | [index] | The Nth icon in a .exe/.dll file. (optional) | |
||
17 | 6 | Per Amundsen | |
18 | |||
19 | *Example* |
||
20 | |||
21 | <pre> |
||
22 | ; Create a custom window. |
||
23 | /window @window |
||
24 | |||
25 | ; Add a menu for the custom window with a menu icon, |
||
26 | ; Notice the use of $+ $chr(58) $+ to make a ":" character, since they are not allowed in the menu text. |
||
27 | menu @window { |
||
28 | $menuicon(c $+ $chr(58) $+ \path\to\image.jpg) This menu has a icon:echo -ag hello world |
||
29 | } |
||
30 | </pre> |