Hi,
I have the code below in Window1, and all works perfectly.
[code] // INSTANTIATE A NEW TOOLBAR ITEM
t = new NSToolbar(“com.richard.toolbar3”, addressOf ToolbarAction)
// SPECIFY THE DEFAULT ITEMS
t.DefaultItems = array(NSToolbarSpaceItemIdentifier, “CREATE”, NSToolbarSpaceItemIdentifier, “DELETE”, NSToolbarFlexibleSpaceItemIdentifier, NSSearchField1.name)
// SPECIFY THE ALLOWED ITEMS
t.AllowedItems = array(“CREATE”, “DELETE”, NSSearchField1.name)
// ADD SEARCH FIELD
tc = new NSToolbarCustomItem(NSSearchField1)
tc.itemLabel = “SEARCH”
// ADD NSSEARCHFIELD TO THE TOOLBAR
t.addItem tc[/code]
I then put exactly the same code in Window2, but I get the following error message:
Any ideas what I am doing wrong???