Re: ERROR:root:Requiring namespace 'Gtk' version '2.0', but '3.0' is already loaded
- From: John Palmieri <johnp redhat com>
- To: Robert Park <rbpark exolucere ca>
- Cc: libchamplain-list gnome org, python-hackers-list <python-hackers-list gnome org>
- Subject: Re: ERROR:root:Requiring namespace 'Gtk' version '2.0', but '3.0' is already loaded
- Date: Tue, 16 Nov 2010 14:54:20 -0500 (EST)
----- "Robert Park" <rbpark exolucere ca> wrote:
> On Tue, Nov 16, 2010 at 11:13 AM, John Palmieri <johnp redhat com>
> wrote:
> > from gi.repository import Gtk
> > Gtk.require_version('2.0')
>
> Thanks J5, you're amazing! I'll try this as soon as I get home
> tonight.
>
> Just a quick thought though -- requiring version 2.0 seems kinda like
> a stopgap solution. I want to be future-proofing my application,
> developing for the latest versions, not ignoring 3.0 with my head
> buried in the sand.
>
> Am I just basically waiting for the Champlain people to catch up with
> gtk3 development, or is there something I can do to make 3.0 work?
>
> Thanks again!
>
> --
> http://exolucere.ca
The issue is Gtk+ 2 and 3 are essentially different libraries so you need to explicitly program to one or the other. To further the issue, they can't exist in the same process space because they are similar enough that they step on each other. Even if they did work in the same process space, you wouldn't want that because it means you can accidentally load both creating bloat. This kind of sucks when another library brings in a dependency on one or the other. This is the case of libchamplain.
There are two things you can do here. You can move to Clutter and use the Champlain Clutter actor instead of the Gtk Widget. This however requires that anyone using your app has good OpenGL drivers for their graphics cards. You can also get Champlain to compile for Gtk3. That should actually be quite easy since I'm guessing Champlain a) uses cairo, and b) doesn't do much with Gtk other than create a widget and draw to it.
--
John (J5) Palmieri
Software Engineer
Red Hat, Inc.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]