Buggy code:
public class TreeItem extends Item { Tree parent ; Image [ ] images ; int itemCount ; int stringList ; int imageList ; int foregroundList ; int backgroundList ; int fontList ; int checkState ; boolean checked ; boolean grayed ; boolean cached ; boolean ignoreNotify ; public TreeItem ( Tree parent , int style ) { } public TreeItem ( Tree parent , int style , int index ) { } public TreeItem ( TreeItem parentItem , int style ) { } public TreeItem ( TreeItem parentItem , int style , int index ) { } TreeItem ( Tree parent , TreeItem parentItem , int style , int index , int handle ) { } static Tree checkNull ( Tree tree ) { } static TreeItem checkNull ( TreeItem item ) { } protected void checkSubclass ( ) { } void clear ( ) { } public void clear ( int index , boolean all ) { } public void clearAll ( boolean all ) { } void columnAdded ( int index ) { } void columnRemoved ( int index ) { } void createHandle ( ) { } void deregister ( ) { } void destroyWidget ( ) { } int findContentPresenter ( int element , int column ) { } int findPart ( int column , String part ) { } public Color getBackground ( ) { } public Color getBackground ( int index ) { } public Rectangle getBounds ( ) { } public Rectangle getBounds ( int index ) { checkWidget ( ) ; if ( ! ( parent . checkData ( this ) ) ) error ( ERROR_WIDGET_DISPOSED ) ; if ( ! ( ( 0 <= index ) && ( index < ( parent . columnCount ) ) ) ) return new Rectangle ( 0 , 0 , 0 , 0 ) ; if ( ! ( OS . UIElement_IsVisible ( handle ) ) ) return new Rectangle ( 0 , 0 , 0 , 0 ) ; int point = OS . gcnew_Point ( 0 , 0 ) ; <START_BUG> OS . UIElement_UpdateLayout ( handle ) ; <END_BUG> int contentPresenter = findContentPresenter ( handle , index ) ; int location = OS . UIElement_TranslatePoint ( contentPresenter , point , parent . handle ) ; int x = ( ( int ) ( OS . Point_X ( location ) ) ) ; int y = ( ( int ) ( OS . Point_Y ( location ) ) ) ; OS . GCHandle_Free ( point ) ; OS . GCHandle_Free ( location ) ; int width = ( ( int ) ( OS . FrameworkElement_ActualWidth ( contentPresenter ) ) ) ; int height = ( ( int ) ( OS . FrameworkElement_ActualHeight ( contentPresenter ) ) ) ; return new Rectangle ( x , y , width , height ) ; } public boolean getChecked ( ) { } public boolean getExpanded ( ) { } public Font getFont ( ) { } public Font getFont ( int index ) { } public Color getForeground ( ) { } public Color getForeground ( int index ) { } public boolean getGrayed ( ) { } public TreeItem getItem ( int index ) { } public int getItemCount ( ) { } public TreeItem [ ] getItems ( ) { } public Image getImage ( ) { } public Image getImage ( int index ) { } public Rectangle getImageBounds ( int index ) { } public Tree getParent ( ) { } public TreeItem getParentItem ( ) { } public String getText ( ) { } public String getText ( int index ) { } Control getWidgetControl ( ) { } public int indexOf ( TreeItem item ) { } void register ( ) { } void releaseChildren ( boolean destroy ) { } void releaseHandle ( ) { } void releaseWidget ( ) { } public void removeAll ( ) { } public void setBackground ( Color color ) { } public void setBackground ( int index , Color color ) { } public void setChecked ( boolean checked ) { } public void setExpanded ( boolean expanded ) { } public void setFont ( Font font ) { } public void setFont ( int index , Font font ) { } public void setForeground ( Color color ) { } public void setForeground ( int index , Color color ) { } public void setGrayed ( boolean grayed ) { } public void setImage ( Image [ ] images ) { } public void setImage ( int index , Image image ) { } public void setImage ( Image image ) { } public void setItemCount ( int count ) { } public void setText ( String [ ] strings ) { } public void setText ( int index , String string ) { } public void setText ( String string ) { } void updateCheckState ( boolean notify ) { } }

Fix:
updateLayout ( handle ) ;