(_HOWTO_ howto create toolbar button by macro)
If those 2 are the only ones, you probably need to add an image too:
KM75 Image for everywhere incl. menus:
setcmdicon("macros(xy)","imagexy.bmp")
There is also a command
setbuttonimg(toolbar,command,icons)
This is only needed if you want a DIFFERENT button image and menuicon, or to change the button pic later during a session.
In KM75.0 that was also needed to avoid zooming of the toolbar buttons, which looked awful.
(Just experimented a lot with that stuff, but next month will probably have it forgotten again ;-)
--------
Shamelessly copying a button from JamesD here,
ultrashort version for KM75.1
("targets" is the toolbar name)
_dragTarget_buttons {
addtoolbar("targets") ;
addbutton("targets", "openLinkInNewTab");
setcmdicon("openLinkInNewTab", "newTab.png" );
}
--------
Personally I still prefer to work with variables for button creation, although it's not necessary any more since KM75 and looks much longer. Using that as template:
mymacro_buildButton{
$_toolbar="My Toolbar";
$_command= "macros(mine)";
$_icons="MyImage.bmp";
$_right_menu="My right-click menu";
$_tooltip="My Tooltip (avoid commas)";
#
addtoolbar($_toolbar);
addbutton( $_toolbar,$_command,$_right_menu,$_tooltip);
setcmdicon($_command,$_icons);
$_toolbar=""; $_command=""; $_right_menu=""; $_tooltip=""; $_icons="";
}
Edited 5 time(s). Last edit at 10/06/2019 01:12PM by siria.