static VALUE rg_class_path(VALUE self) { guint path_length; gchar *path; gchar *path_reversed; VALUE str_path; VALUE str_path_reversed; gtk_widget_class_path(_SELF(self), &path_length, &path, &path_reversed); str_path = CSTR2RVAL(path); str_path_reversed = CSTR2RVAL(path_reversed); g_free(path); g_free(path_reversed); return rb_ary_new3(2, str_path, str_path_reversed); }
static void print_widget_path (GtkWidget *widget) { static GtkWidget *previous = NULL; gchar *path; /* prevent printing lots of duplicates */ if (previous == widget) return; previous = widget; gtk_widget_path (widget, NULL, &path, NULL); printf ("widget: %s\n", path); g_free (path); gtk_widget_class_path (widget, NULL, &path, NULL); printf ("widget_class: %s\n\n", path); g_free (path); }