Has anyone used multiple windows/rendering contexts?

I'm working on a map editor for my project and I wanted to add a preview window for the material editor, so that the textures/shaders can be seen in action right away.

However, I haven't figured out the way to deal with the contexts, should I have a thread running for each context and use that for drawing on that particular context? I tried using one thread for both contexts and I keep getting "invalid operation" OpenGL errors. When using application idle event everything works but a bit choppy, the animation etc. isn't smooth enough this way.

I'm doing this in Delphi/Windows, but a cross-platform friendly method would be nice to have.