Loading...
Searching...
No Matches
Layout API tips

BWindow Tips

  • You can use the BLayoutBuilder classes to build a layout directly into a BWindow.
  • Passing the B_AUTO_UPDATE_SIZE_LIMITS flag to a BWindow with a BLayout will make sure that window is always big enough to accomadate everything in it.

BView Tips

  • When the main purpose of a BView is to hold another BView which has children added to it, consider adding directly to the first BView.
  • When the main purpose of a BView is to hold a BLayout, but you also wish to have a view color set for that area, considering using one of the layout-related convenience classes (eg. BGroupView for BGroupLayout).
  • When the main purpose of a BView is to hold a BLayout, but it must be populated before being attached to another BView or a BWindow, consider using one of the layout-related convenience classes (eg. BGroupView for BGroupLayout).

BLayout Tips

  • It is generally better to add BViews and BLayoutItems directly to the BLayout subclass attached to a BView, rather than the BView itself. This way, you can make full use of the specific features the subclass you're using provides.