isolate layout functions from gt.draw?

I'm trying to use the node positions calculated by sfdp_layout in a galry
visualization, but am running into the problem of conflicting GTK+ symbols
(galry uses GTK+ 2). I'm thinking this could be avoided if the layout
functions were not part of gt.draw... but any suggestions for a workaround?

Thanks,
-Rick

attachment.html (374 Bytes)

You can disable all functions which depend on GTK by commenting out the
last bit in (line 987 onwards):

     https://projects.skewed.de/graph-tool/browser/src/graph_tool/draw/cairo_draw.py

By looking at the galry website, it seems they also support Qt. An
alternative would be to configure it to use Qt instead, which would not
cause any symbol collision.

Ideally, the best way would be to detect if GTK+2 is already imported,
before trying to import GTK+3, but I'm not sure if it is possible. I'll
look into this...

Cheers,
Tiago

Hi Tiago,

On Tue, Jul 9, 2013 at 1:47 AM, Tiago de Paula Peixoto <tiago(a)skewed.de>wrot

By looking at the galry website, it seems they also support Qt. An
alternative would be to configure it to use Qt instead, which would not
cause any symbol collision.

Actually it seems galry uses only Qt, but I think the default Qt theme in
Ubuntu pulls in GTK+ 2 symbols for some reason.

Ideally, the best way would be to detect if GTK+2 is already imported,
before trying to import GTK+3, but I'm not sure if it is possible. I'll
look into this...

What about the idea of being able to import the *_layout functions without
importing cairo_draw?

attachment.html (1.24 KB)

Hi Tiago,

On Tue, Jul 9, 2013 at 1:47 AM, Tiago de Paula Peixoto <tiago(a)skewed.de <mailto:tiago(a)skewed.de>> wrot

    By looking at the galry website, it seems they also support Qt. An
    alternative would be to configure it to use Qt instead, which would not
    cause any symbol collision.

Actually it seems galry uses only Qt, but I think the default Qt theme in Ubuntu pulls in GTK+ 2 symbols for some reason.

This means it is using a GTK+ theme as a backend. A workaround would be
to change the Qt theme to something else.

    Ideally, the best way would be to detect if GTK+2 is already imported,
    before trying to import GTK+3, but I'm not sure if it is possible. I'll
    look into this...

What about the idea of being able to import the *_layout functions without importing cairo_draw?

This requires reorganizing the code. Note that everything works if GTK
is not available at all, and you get simply the layout functions,
without any drawing. Ideally, one should get the same thing if GTK+ is
not importable due to symbol conflicts.

Cheers,
Tiago