macoslib ToolbarAction ?

Hello,
I have the following code which successfully creates a button item in my macoslib toolbar:

[code] // INSTANTIATE A NEW TOOLBAR ITEM
t = new NSToolbar(“com.richard.toolbar”, addressOf ToolbarAction)

// SPECIFY THE DEFAULT ITEMS
t.DefaultItems = array(NSToolbarSpaceItemIdentifier, “Button1”, NSSearchField1.name)

// SPECIFY THE ALLOWED ITEMS
t.AllowedItems = array(“Button1”, NSSearchField1.name)

// ADD A BUTTON
ti = new NSToolbarButtonItem(“Button1”)
ti.Image = NSImage.HomeTemplate
ti.ItemLabel = “Button1”

// ADD BUTTON TO THE TOOLBAR
t.addItem ti[/code]

Could someone please tell me where and how I test for Button1 being pressed.
I have looked at the macoslib example, but can’t work out what is happening??

Thanks.

Solved it myself :slight_smile:

For anyone else who may be struggling - place the following code inside the ToolbarAction method.

If identifier = "Button1" then MsgBox("Test") End if