+ lbHeight += 10;
+
+ // Get the visible area of the tree view (limit to the 10th item
+ // so that it isn't too big)
+ int count = GetCount();
+ if (count)
+ {
+ int wLine;
+
+ // Find the widest line
+ for(int i = 0; i < count; i++) {
+ wxString str(GetString(i));
+ GetTextExtent(str, &wLine, NULL);
+ lbWidth = wxMax(lbWidth, wLine);
+ }
+
+ lbWidth += 3 * cx;
+
+ // And just a bit more for the checkbox if present and then some
+ // (these are rough guesses)
+#if wxUSE_CHECKLISTBOX && wxUSE_NATIVEGTKCHECKLIST
+ if ( m_hasCheckBoxes )
+ {
+ lbWidth += 35;
+ cy = cy > 25 ? cy : 25; // rough height of checkbox
+ }
+#endif