The Shape of Everything
A website mostly about Mac stuff, written by August "Gus" Mueller
» Acorn
» Retrobatch
» Mastodon
» Micro.blog
» Instagram
» Github
» Maybe Pizza?
» Archives
» Feed
» Micro feed
October 13, 2009
(This post is from my old, old, super old site. My views have changed over the years, hopefully my writing has improved, and there is now more than a handful of folks reading my site. Enjoy.)

VoodooPad 4 added the ability for plugin authors to add support for specific data types in VoodooPad, which would be saved as a page in the document it was created in. So for instance, if you wanted to support some strange data type, that could be done. Or a custom image viewer, you could do that too. Maybe you fancy an outliner? Or maybe you wanted a little editor for JSTalk pages, which are saved right in the document where you got your syntax highlighting and a little run button.

OK, no big surprise, I just wrote that last one, and here's a movie of it in action: JSTalkInVP.mov. It's not built into VP yet, but I'll get that done for a future release when I'm happier with the UI. Source is here on github.

If you wanted to write your own plugin to do something similar, subclass VPItemController (which is a subclass of NSViewController), register yourself it VP so it knows about your data type, and implement some methods for loading and unloading data, and load a nib of your choice for the UI. It's quite simple, and of course welcome feedback on how to make it better.