4D v16.3

SET MENU ITEM ICON

Home

 
4D v16.3
SET MENU ITEM ICON

SET MENU ITEM ICON 


 

SET MENU ITEM ICON ( menu ; menuItem ; iconRef {; process} )  
Parameter Type   Description
menu  Longint, MenuRef in Menu reference or Menu number
menuItem  Longint in Number of menu item or -1 for the last item added to the menu
iconRef  Text, Longint in Name or number of picture to be associated with menu item
process  Longint in Process number

The SET MENU ITEM ICON command modifies the icon associated with the menu item designated by the menu and menuItem parameters.
You can pass -1 in menuItem in order to specify the last item added to menu.

In menu, you can pass a menu reference (MenuRef) or a menu number. If you pass a menu reference, the command will apply to all the instances of the menu in all the processes. In this case, the process parameter is ignored if it is passed. If you pass a menu number, the command will take the corresponding menu in the main menu bar of the current process into account. If you want to designate another process, pass its number in the optional process parameter.

In iconRef, you can pass the picture to be used as the icon. You can use a library picture or a picture reference.

  • Library picture: You can pass either the name or number of the picture. It is generally preferable to use its number rather than its name since picture numbers are unique IDs, which is not the case with names.
  • Picture reference: The picture must be located in the Resources folder of the database and you must use a "file:{pathname}fileName" type syntax in iconRef. For more information about the Resources folder, refer to the Resources section.

Example  

Use of a picture located in the Resources folder of the database:

 SET MENU ITEM ICON($MenuRef;2;"File:English.lproj/spot.png")



See also 

GET MENU ITEM ICON

 
PROPERTIES 

Product: 4D
Theme: Menus
Number: 984

 
HISTORY 

Created: 4D v11 SQL

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)