gtk.Pixmap

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

gtk.Pixmap

Etienne Robillard-6
Hi,

How can I access gtk.Pixmap under PyGObject and Python 3 ? I'm using the
pygtkcompat package.

TIA,

E

--

Etienne Robillard
[hidden email]
http://www.isotopesoftware.ca/

_______________________________________________
pygtk mailing list   [hidden email]
http://mailman.daa.com.au/cgi-bin/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
Reply | Threaded
Open this post in threaded view
|

Re: gtk.Pixmap

Etienne Robillard-6
Here's the traceback I get from my app:


13:24:57 environ              No en_CA translation found for domain gazpacho
schevo.store using Python base classes for persistence.
Traceback (most recent call last):
   File "<frozen importlib._bootstrap>", line 890, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
   File "/usr/local/bin/schevo", line 11, in <module>
     load_entry_point('libschevo', 'console_scripts', 'schevo')()
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line
561, in load_entry_point
     return get_distribution(dist).load_entry_point(group, name)
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line
2631, in load_entry_point
     return ep.load()
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line
2291, in load
     return self.resolve()
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line
2297, in resolve
     module = __import__(self.module_name, fromlist=['__name__'], level=0)
   File "/home/erob/src/libschevo-devel/lib/schevo/script/main.py", line
27, in <module>
     start = Main()
   File "/home/erob/src/libschevo-devel/lib/schevo/script/main.py", line
24, in __init__
     command = p.load()
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line
2291, in load
     return self.resolve()
   File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line
2297, in resolve
     module = __import__(self.module_name, fromlist=['__name__'], level=0)
   File "/home/erob/src/libschevo-devel/lib/schevo/gtk2/script.py", line
17, in <module>
     from schevo.gtk2.application import Application
   File "/home/erob/src/libschevo-devel/lib/schevo/gtk2/application.py",
line 9, in <module>
     from schevo.gtk2.navigator import NavigatorWindow
   File "/home/erob/src/libschevo-devel/lib/schevo/gtk2/navigator.py",
line 29, in <module>
     from schevo.gtk2.window import Window
   File "/home/erob/src/libschevo-devel/lib/schevo/gtk2/window.py", line
27, in <module>
     from schevo.gtk2.widgettree import GladeSignalBroker, WidgetTree
   File "/home/erob/src/libschevo-devel/lib/schevo/gtk2/widgettree.py",
line 11, in <module>
     from schevo.gtk2 import gazpacholoader
   File
"/home/erob/src/libschevo-devel/lib/schevo/gtk2/gazpacholoader.py", line
19, in <module>
     from gazpacho.loader.custom import (
   File
"/home/erob/src/django-hotsauce-devel/extras/gazpacho/gazpacho/loader/custom.py",
line 22, in <module>
     from gi.repository import Pixmap
   File "/usr/lib/python3/dist-packages/gi/importer.py", line 127, in
find_module
     'introspection typelib not found' % namespace)
ImportError: cannot import name Pixmap, introspection typelib not found


Any help would be very appreciated.

Etienne


On 22/10/17 09:36 AM, Etienne Robillard wrote:
> Hi,
>
> How can I access gtk.Pixmap under PyGObject and Python 3 ? I'm using
> the pygtkcompat package.
>
> TIA,
>
> E
>

_______________________________________________
pygtk mailing list   [hidden email]
http://mailman.daa.com.au/cgi-bin/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
Reply | Threaded
Open this post in threaded view
|

Re: gtk.Pixmap

Etienne Robillard-6

Anyone have an idea what I'm doing wrong?

I use to access gtk.Pixmap without problems on python 2.7:

­­­­>>> import gtk

>>> gtk.Pixmap

Why is this code not working on python 3/pygobject ?

E

Le 2017-10-22 à 13:38, Etienne Robillard a écrit :
Here's the traceback I get from my app:


13:24:57 environ              No en_CA translation found for domain gazpacho
schevo.store using Python base classes for persistence.
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 890, in _find_spec
AttributeError: 'DynamicImporter' object has no attribute 'find_spec'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/schevo", line 11, in <module>
    load_entry_point('libschevo', 'console_scripts', 'schevo')()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 561, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/erob/src/libschevo-devel/lib/schevo/script/main.py", line 27, in <module>
    start = Main()
  File "/home/erob/src/libschevo-devel/lib/schevo/script/main.py", line 24, in __init__
    command = p.load()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/erob/src/libschevo-devel/lib/schevo/gtk2/script.py", line 17, in <module>
    from schevo.gtk2.application import Application
  File "/home/erob/src/libschevo-devel/lib/schevo/gtk2/application.py", line 9, in <module>
    from schevo.gtk2.navigator import NavigatorWindow
  File "/home/erob/src/libschevo-devel/lib/schevo/gtk2/navigator.py", line 29, in <module>
    from schevo.gtk2.window import Window
  File "/home/erob/src/libschevo-devel/lib/schevo/gtk2/window.py", line 27, in <module>
    from schevo.gtk2.widgettree import GladeSignalBroker, WidgetTree
  File "/home/erob/src/libschevo-devel/lib/schevo/gtk2/widgettree.py", line 11, in <module>
    from schevo.gtk2 import gazpacholoader
  File "/home/erob/src/libschevo-devel/lib/schevo/gtk2/gazpacholoader.py", line 19, in <module>
    from gazpacho.loader.custom import (
  File "/home/erob/src/django-hotsauce-devel/extras/gazpacho/gazpacho/loader/custom.py", line 22, in <module>
    from gi.repository import Pixmap
  File "/usr/lib/python3/dist-packages/gi/importer.py", line 127, in find_module
    'introspection typelib not found' % namespace)
ImportError: cannot import name Pixmap, introspection typelib not found


Any help would be very appreciated.

Etienne


On 22/10/17 09:36 AM, Etienne Robillard wrote:
Hi,

How can I access gtk.Pixmap under PyGObject and Python 3 ? I'm using the pygtkcompat package.

TIA,

E


_______________________________________________
pygtk mailing list   [hidden email]
http://mailman.daa.com.au/cgi-bin/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

-- 
Etienne Robillard
[hidden email]
http://www.isotopesoftware.ca/

_______________________________________________
pygtk mailing list   [hidden email]
http://mailman.daa.com.au/cgi-bin/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
Reply | Threaded
Open this post in threaded view
|

Re: gtk.Pixmap

Neil Muller-10
In reply to this post by Etienne Robillard-6
On 22 October 2017 at 15:36, Etienne Robillard <[hidden email]> wrote:
> Hi,
>
> How can I access gtk.Pixmap under PyGObject and Python 3 ? I'm using the
> pygtkcompat package.

gtk.Pixmap was removed in gtk 3 [1]., so consequently gi and
pygtkcompat don't support it.

You'll need to convert the code to either use a cairo surface, or to
work with some other type of image object.

[1] https://developer.gnome.org/gtk3/stable/ch26s02.html#id-1.6.3.4.5

--
Neil Muller
[hidden email]
_______________________________________________
pygtk mailing list   [hidden email]
http://mailman.daa.com.au/cgi-bin/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/
Reply | Threaded
Open this post in threaded view
|

Re: gtk.Pixmap

Etienne Robillard-6
Thanks for your reply, Neil.

I found a solution by using Gtk.Image as a replacement for Pixmap in my app.

Etienne


Le 2017-10-24 à 05:53, Neil Muller a écrit :

> On 22 October 2017 at 15:36, Etienne Robillard <[hidden email]> wrote:
>> Hi,
>>
>> How can I access gtk.Pixmap under PyGObject and Python 3 ? I'm using the
>> pygtkcompat package.
> gtk.Pixmap was removed in gtk 3 [1]., so consequently gi and
> pygtkcompat don't support it.
>
> You'll need to convert the code to either use a cairo surface, or to
> work with some other type of image object.
>
> [1] https://developer.gnome.org/gtk3/stable/ch26s02.html#id-1.6.3.4.5
>

--
Etienne Robillard
[hidden email]
http://www.isotopesoftware.ca/

_______________________________________________
pygtk mailing list   [hidden email]
http://mailman.daa.com.au/cgi-bin/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/