don't use deprecated gtk_object_sink(), replace it with g_object_ref_sink()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56345 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2008-10-15 19:14:46 +00:00
parent fde87a8276
commit 01603d4396
4 changed files with 5 additions and 9 deletions

View File

@ -28,11 +28,7 @@
#include "wx/module.h" #include "wx/module.h"
#endif #endif
#include <gtk/gtkversion.h>
#if GTK_CHECK_VERSION(2, 9, 0)
// gtk_object_sink
#undef GTK_DISABLE_DEPRECATED
#endif
#include <gtk/gtk.h> #include <gtk/gtk.h>
// compatibility with older GTK+ versions: // compatibility with older GTK+ versions:
@ -210,7 +206,7 @@ static GdkPixbuf *CreateStockIcon(const char *stockid, GtkIconSize size)
gs_gtkStyle = gtk_rc_get_style(widget); gs_gtkStyle = gtk_rc_get_style(widget);
wxASSERT( gs_gtkStyle != NULL ); wxASSERT( gs_gtkStyle != NULL );
g_object_ref(gs_gtkStyle); g_object_ref(gs_gtkStyle);
gtk_object_sink((GtkObject*)widget); g_object_ref_sink(widget);
} }
GtkIconSet *iconset = gtk_style_lookup_icon_set(gs_gtkStyle, stockid); GtkIconSet *iconset = gtk_style_lookup_icon_set(gs_gtkStyle, stockid);

View File

@ -1914,7 +1914,7 @@ wxDataViewCustomRenderer::~wxDataViewCustomRenderer()
delete m_dc; delete m_dc;
if (m_text_renderer) if (m_text_renderer)
gtk_object_sink( GTK_OBJECT(m_text_renderer) ); g_object_ref_sink(m_text_renderer);
} }
wxDC *wxDataViewCustomRenderer::GetDC() wxDC *wxDataViewCustomRenderer::GetDC()

View File

@ -706,7 +706,7 @@ void wxMenu::Init()
// NB: keep reference to the menu so that it is not destroyed behind // NB: keep reference to the menu so that it is not destroyed behind
// our back by GTK+ e.g. when it is removed from menubar: // our back by GTK+ e.g. when it is removed from menubar:
g_object_ref(m_menu); g_object_ref(m_menu);
gtk_object_sink(GTK_OBJECT(m_menu)); g_object_ref_sink(m_menu);
m_owner = (GtkWidget*) NULL; m_owner = (GtkWidget*) NULL;

View File

@ -378,7 +378,7 @@ bool wxToolBar::Create( wxWindow *parent,
m_toolbar = GTK_TOOLBAR( gtk_toolbar_new() ); m_toolbar = GTK_TOOLBAR( gtk_toolbar_new() );
m_tooltips = gtk_tooltips_new(); m_tooltips = gtk_tooltips_new();
g_object_ref(m_tooltips); g_object_ref(m_tooltips);
gtk_object_sink(GTK_OBJECT(m_tooltips)); g_object_ref_sink(m_tooltips);
GtkSetStyle(); GtkSetStyle();
if (style & wxTB_DOCKABLE) if (style & wxTB_DOCKABLE)