]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/choice.cpp
Added a notification observer for NSWindow. Observe the become key and
[wxWidgets.git] / src / mac / choice.cpp
index fdd9b43da6c49ac2135d59a0441b2b6d265cc6be..2275ce10c07d3b6a3b0c12013453260ff3d053e6 100644 (file)
@@ -46,6 +46,9 @@ bool wxChoice::Create(wxWindow *parent, wxWindowID id,
            const wxValidator& validator,
            const wxString& name)
 {
+    if ( !wxChoiceBase::Create(parent, id, pos, size, style, validator, name) )
+        return false;
+
     Rect bounds ;
     Str255 title ;
 
@@ -177,8 +180,12 @@ void wxChoice::SetString(int n, const wxString& s)
 
 wxString wxChoice::GetString(int n) const
 {
+    wxCHECK_MSG( n >= 0 && (size_t)n < m_strings.GetCount(), _T(""),
+                    _T("wxChoice::GetString(): invalid index") );
+
     return m_strings[n] ;
 }
+
 // ----------------------------------------------------------------------------
 // client data
 // ----------------------------------------------------------------------------