Bits and Pieces: The Small BCardLayout

Blog post by Sil2100 on Sat, 2012-01-21 20:14

A short post about something that's not really documented. When working on a communication application for Haiku, I needed to create a typical configuration wizard window. I required a few views to be present in one spot, with only one being shown at the same time - with the ability to switch between them on user Next/Prev button press. Since Haiku exports a neat layout API, I wanted to use one of those if only possible. And then I found the BCardLayout.

Since the Haiku API is still being worked on, some places are not yet well documented - with others not documented at all. The BCardLayout is the latter. It's a rather easy-to-use feature though. There's a living example in the Haiku core code as well - in the media preferences application (check out src/preferences/media