Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ArtOfWarfare

macrumors G3
Original poster
Nov 26, 2007
9,559
6,059
I'm making a simple IDE. The language allows for extremely free form text, but to keep it beginner friendly, I'd like to allow the user to simply drag and drop prewritten code, in the form of tokens, into their code. Not everything will be drag and drop - I want this to be useful for everyone, so more experienced users can just type their own code in directly... and intermediates can mix and match between raw text and tokens.

Essentially the tokens are like functions in C. The tokens just have a function name on them, but if the user mouses over them, it should give function's implementation as a tooltip.

Does this seem like a fine UI / use of tokens?

I tried making the UI by just dragging an NSTokenField into my xib, but this seems to have two major problems:

1 - It converts everything into tokens. Is it not possible to allow tokens and text to intermingle?
2 - NSTokenField doesn't seem to be capable of scrolling vertically.

Does anyone have any suggestions for either a better UI or ideas for how to overcome 1 & 2? I was just going to make this app as a quick ~10 hour project, ideally just using standard cocoa controls. Trying to roll my own token field class seems like it would take an awful lot of effort for such a simple application.

(This is an IDE for a domain specific language.)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.