-bool wxListBox::Create( wxWindow *parent, wxWindowID id,
- const wxPoint &pos, const wxSize &size,
- int n, const wxString choices[],
- long style, const wxString &name )
-{
- m_needParent = TRUE;
-
- PreCreation( parent, id, pos, size, style, name );
-
- m_widget = gtk_scrolled_window_new( NULL, NULL );
- gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
- GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
-
- m_list = GTK_LIST( gtk_list_new() );
-
- // @@ what's the difference between BROWSE and SINGLE?
- GtkSelectionMode mode = GTK_SELECTION_BROWSE;
- if ( style & wxLB_MULTIPLE )
- mode = GTK_SELECTION_MULTIPLE;
- else if ( style & wxLB_EXTENDED )
- mode = GTK_SELECTION_EXTENDED;
-
- gtk_list_set_selection_mode( GTK_LIST(m_list), mode );
+ PreCreation( parent, id, pos, size, style, name );
+
+ SetValidator( validator );
+
+ m_widget = gtk_scrolled_window_new( (GtkAdjustment*) NULL, (GtkAdjustment*) NULL );
+ gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(m_widget),
+ GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC );
+
+ m_list = GTK_LIST( gtk_list_new() );
+
+ GtkSelectionMode mode = GTK_SELECTION_BROWSE;
+ if (style & wxLB_MULTIPLE)
+ mode = GTK_SELECTION_MULTIPLE;
+ else if (style & wxLB_EXTENDED)
+ mode = GTK_SELECTION_EXTENDED;
+
+ gtk_list_set_selection_mode( GTK_LIST(m_list), mode );
+
+#ifdef NEW_GTK_SCROLL_CODE
+ gtk_scrolled_window_add_with_viewport( GTK_SCROLLED_WINDOW(m_widget), GTK_WIDGET(m_list) );
+#else
+ gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_list) );
+#endif
+
+ gtk_widget_show( GTK_WIDGET(m_list) );
+
+ wxSize newSize = size;
+ if (newSize.x == -1) newSize.x = 100;
+ if (newSize.y == -1) newSize.y = 110;
+ SetSize( newSize.x, newSize.y );
+
+ for (int i = 0; i < n; i++)
+ {
+ m_clientDataList.Append( (wxObject*) NULL );
+ m_clientObjectList.Append( (wxObject*) NULL );