How to attach macro to new command in my custom toolbar?

I created new toolbar. Now I want to add command and attach a macro from my module to this command. How to do it?

Hello,

Adding commands to menus or toolbars is in the LO documentation found here. Look in Getting Started with LibreOffice Chapter 14 - Customizing LibreOffice. LibreOffice Macros is near the end of the Categories list.