]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/classic/listbox.cpp
Fix some bugs
[wxWidgets.git] / src / mac / classic / listbox.cpp
index b1d70172ae36edbb15126b9f94b2d69a388b7ae5..44b2948d33dd70271c76035d82d92de12945febe 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     1998-01-01
 // RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
-// Licence:     wxWidgets licence
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
@@ -265,7 +265,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
 
     long    result ;
     wxStAppResource resload ;
-    m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false ,
+    m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false ,
                   (style & wxLB_HSCROLL) ? kwxMacListWithVerticalAndHorizontalScrollbar : kwxMacListWithVerticalScrollbar , 
                   0 , 0, kControlListBoxProc , (long) this ) ;
     ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxListHandleTag ,
@@ -401,6 +401,8 @@ void wxListBox::Delete(int N)
 
 int wxListBox::DoAppend(const wxString& item)
 {
+    InvalidateBestSize();
+
     int index = m_noItems ;
     m_stringArray.Add( item ) ;
     m_dataArray.Add( NULL );
@@ -595,6 +597,8 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
     wxCHECK_RET( pos >= 0 && pos <= m_noItems,
         wxT("invalid index in wxListBox::InsertItems") );
     
+    InvalidateBestSize();
+
     int nItems = items.GetCount();
     
     for ( int i = 0 ; i < nItems ; i++ )