]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/choice.cpp
-Debian glibc2 system is 'linux-gnu', not 'Linux';updated .cvsignore's -Markus
[wxWidgets.git] / src / gtk1 / choice.cpp
index 09af84d007cdba14185c1999f21a953bf4520f73..039b4fda7ff8e66bd186989662b0f5425c804896 100644 (file)
@@ -122,11 +122,17 @@ int wxChoice::FindString( const wxString &string ) const
     GtkBin *bin = GTK_BIN( child->data );
     GtkLabel *label = NULL;
     if (bin->child) label = GTK_LABEL(bin->child);
+    
+    wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
+    
     if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
     if (string == label->label) return count;
     child = child->next;
     count++;
   };
+  
+  wxFAIL_MSG( "wxChoice: string not found" );
+  
   return -1;
 };
 
@@ -147,6 +153,9 @@ int wxChoice::GetSelection(void)
     child = child->next;
     count++;
   };
+  
+  wxFAIL_MSG( "wxChoice: no selection" );
+  
   return -1;
 };
 
@@ -162,18 +171,27 @@ wxString wxChoice::GetString( int n ) const
     {
       GtkLabel *label = NULL;
       if (bin->child) label = GTK_LABEL(bin->child);
+      
+      wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
+      
       if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
       return label->label;
     };
     child = child->next;
     count++;
   };
+  
+  wxFAIL_MSG( "wxChoice: string not found" );
+  
   return "";
 };
 
 wxString wxChoice::GetStringSelection(void) const
 {
   GtkLabel *label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
+  
+  wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
+  
   return label->label;
 };