Quote
dnasty
what im i doing wrong?
1) No need to edit menus.cfg, you can do that all in your macro.
2) ID commands have to be called using the
id() method (what desga2 mentioned).
3) Usage of
setmenu() is a bit tricky. Look into menus.cfg to learn what menus/items you have to modify.
myPrefs.kmm:
myPrefs{
alert("Be careful,This page controls the settings","Warning");
id("ID_PREFERENCES");
}
_myPrefs_BuildMenu{
# Add the new item on top of the old:
setmenu(Preferences,macro,"Pr&eferences",myPrefs,ID_PREFERENCES);
# Remove the old item:
setmenu(Preferences,command,"",ID_PREFERENCES);
}
$OnInit=$OnInit."_myPrefs_BuildMenu;";
_myPrefs_SetAccels{
# Redirect the F2 accel too:
setaccel(VK_F2,"macros(myPrefs)");
}
$OnInit=$OnInit."_myPrefs_SetAccels;";