]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/listbox.cpp
more backwards compatibility for printing
[wxWidgets.git] / src / gtk / listbox.cpp
index 07b6eede12ef9af66d9e3a32ec7dc1adce0fd08d..818775ee732b711ab18e00b7cf69e01b3bc3bf29 100644 (file)
 // conditional compilation
 //-------------------------------------------------------------------------
 
-#if (GTK_MINOR_VERSION == 1)
-    #if (GTK_MICRO_VERSION >= 5)
-        #define NEW_GTK_SCROLL_CODE
-    #endif
+#if (GTK_MINOR_VERSION > 0)
+#define NEW_GTK_SCROLL_CODE
 #endif
 
 //-----------------------------------------------------------------------------
@@ -96,17 +94,16 @@ gtk_listbox_button_press_callback( GtkWidget *widget, GdkEventButton *gdk_event,
             event.m_commandInt = aSelections[0] ;
             event.m_clientData = listbox->GetClientData( event.m_commandInt );
             wxString str(listbox->GetString(event.m_commandInt));
-            if (str != "") event.m_commandString = copystring((char *)(const char *)str);
+            if (!str.IsEmpty()) event.m_commandString = str;
         }
         else
         {
             event.m_commandInt = -1 ;
-            event.m_commandString = copystring("") ;
+            event.m_commandString.Empty();
         }
 
         listbox->GetEventHandler()->ProcessEvent( event );
 
-        if (event.m_commandString) delete[] event.m_commandString ;
     }
 
     return FALSE;
@@ -157,18 +154,17 @@ static void gtk_listitem_select_callback( GtkWidget *WXUNUSED(widget), wxListBox
         event.m_commandInt = aSelections[0] ;
         event.m_clientData = listbox->GetClientData( event.m_commandInt );
         wxString str(listbox->GetString(event.m_commandInt));
-        if (str != "") event.m_commandString = copystring((char *)(const char *)str);
+        if (!str.IsEmpty()) event.m_commandString = str;
     }
     else
     {
         event.m_commandInt = -1 ;
-        event.m_commandString = copystring("") ;
+        event.m_commandString.Empty();
     }
 
     event.SetEventObject( listbox );
 
     listbox->GetEventHandler()->ProcessEvent( event );
-    if (event.m_commandString) delete[] event.m_commandString ;
 }
 
 //-----------------------------------------------------------------------------
@@ -226,7 +222,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id,
     debug_focus_in( s_window->vscrollbar, "wxWindow::vsrcollbar", name );
 
 #ifdef NEW_GTK_SCROLL_CODE
-    GtkViewport *viewport = GTK_VIEWPORT(s_window->child);
+    GtkViewport *viewport = GTK_VIEWPORT( GTK_BIN(s_window)->child );
 #else
     GtkViewport *viewport = GTK_VIEWPORT(s_window->viewport);
 #endif