gremlin failing to import on startup: undefined symbol: GTK_WIDGET_REALIZED

More
06 Jun 2017 21:43 #94204 by n81641
n81641 created the topic: gremlin failing to import on startup: undefined symbol: GTK_WIDGET_REALIZED
If you are using the pyGTK gremlin.py, you may find that it fails on import, with

ImportError: /usr/local/lib/libgtkglext-x11-1.0.so.0: undefined symbol: GTK_WIDGET_REALIZED

I fixed this by downloading the source code for gtkglext and applying the patch below. Then just ./configure, make, sudo make install.

#! /bin/sh /usr/share/dpatch/dpatch-run
## 02_fix_gtk-2.20_deprecated_symbols.dpatch taken from git upstream's repo
## by Gilles Filippini <address@hidden>.
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Upstream git commit: d8f285d1397f6c41099c67e668288eecc1cdae67
## DP: Eliminate usage of GTK_WIDGET_REALIZED, GTK_WIDGET_TOPLEVEL, and
## DP: GTK_WIDGET_NO_WINDOW for compatibility with Gtk+ >= 2.20.

@DPATCH@

---
diff --git a/examples/pixmap-mixed.c b/examples/pixmap-mixed.c
index 2346afd..3e53f14 100644
--- a/examples/pixmap-mixed.c
+++ b/examples/pixmap-mixed.c
@@ -154,7 +154,7 @@ expose_event (GtkWidget *widget,
gpointer data)
{
gdk_draw_drawable (widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ widget->style->fg_gc[gtk_widget_get_state (widget)],
pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
diff --git a/examples/pixmap.c b/examples/pixmap.c
index 10e6fc1..a14a1b7 100644
--- a/examples/pixmap.c
+++ b/examples/pixmap.c
@@ -137,7 +137,7 @@ expose_event (GtkWidget *widget,
gpointer data)
{
gdk_draw_drawable (widget->window,
- widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
+ widget->style->fg_gc[gtk_widget_get_state (widget)],
pixmap,
event->area.x, event->area.y,
event->area.x, event->area.y,
diff --git a/gtk/gtkglwidget.c b/gtk/gtkglwidget.c
index 76a93d6..ca60626 100644
--- a/gtk/gtkglwidget.c
+++ b/gtk/gtkglwidget.c
@@ -129,7 +129,7 @@ gtk_gl_widget_size_allocate (GtkWidget *widget,
* Synchronize OpenGL and window resizing request streams.
*/

- if (GTK_WIDGET_REALIZED (widget) && private->is_realized)
+ if (gtk_widget_get_realized (widget) && private->is_realized)
{
gldrawable = gdk_window_get_gl_drawable (widget->window);
gdk_gl_drawable_wait_gdk (gldrawable);
@@ -156,7 +156,7 @@ gtk_gl_widget_unrealize (GtkWidget *widget,
* Remove OpenGL-capability from widget->window.
*/

- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_realized (widget))
gdk_window_unset_gl_capability (widget->window);

private->is_realized = FALSE;
@@ -176,7 +176,7 @@ gtk_gl_widget_parent_set (GtkWidget *widget,
*/

toplevel = gtk_widget_get_toplevel (widget);
- if (GTK_WIDGET_TOPLEVEL (toplevel) && !GTK_WIDGET_REALIZED (toplevel))
+ if (gtk_widget_is_toplevel (toplevel) && !gtk_widget_get_realized (toplevel))
{
GTK_GL_NOTE (MISC,
g_message (" - Install colormap to the top-level window."));
@@ -196,7 +196,7 @@ gtk_gl_widget_style_set (GtkWidget *widget,
* Set a background of "None" on window to avoid AIX X server crash.
*/

- if (GTK_WIDGET_REALIZED (widget))
+ if (gtk_widget_get_realized (widget))
{
GTK_GL_NOTE (MISC,
g_message (" - window->bg_pixmap = %p",
@@ -252,8 +252,8 @@ gtk_widget_set_gl_capability (GtkWidget *widget,
GTK_GL_NOTE_FUNC ();

g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- g_return_val_if_fail (!GTK_WIDGET_NO_WINDOW (widget), FALSE);
- g_return_val_if_fail (!GTK_WIDGET_REALIZED (widget), FALSE);
+ g_return_val_if_fail (gtk_widget_get_has_window (widget), FALSE);
+ g_return_val_if_fail (!gtk_widget_get_realized (widget), FALSE);
g_return_val_if_fail (GDK_IS_GL_CONFIG (glconfig), FALSE);

/*
@@ -434,7 +434,7 @@ gtk_widget_create_gl_context (GtkWidget *widget,
GTK_GL_NOTE_FUNC ();

g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
+ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);

gldrawable = gdk_window_get_gl_drawable (widget->window);
if (gldrawable == NULL)
@@ -476,7 +476,7 @@ gtk_widget_get_gl_context (GtkWidget *widget)
GLWidgetPrivate *private;

g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
+ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);

private = g_object_get_qdata (G_OBJECT (widget), quark_gl_private);
if (private == NULL)
@@ -503,7 +503,7 @@ GdkGLWindow *
gtk_widget_get_gl_window (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
+ g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);

return gdk_window_get_gl_window (widget->window);
}
--
cgit v0.8.3.1
Time to create page: 0.059 seconds
Powered by Kunena Forum