Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python-fu plugin UI
#5
(01-16-2019, 11:21 PM)Ofnuts Wrote: The only example I understand:  https://sourceforge.net/projects/gimp-to...y/download

Thanks very much! Looking at the example, you used pygtk with gtk 2.0. Do you think it is possible to use gtk+ 3 with python-fu? At the moment I've tryed to do:

Code:
from gimpfu import *
import gi
import os
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk as gtk, GObject, GdkPixbuf
GObject.threads_init()

but I'm getting this error when executing grimp from the terminal:

Code:
Traceback (most recent call last):
 File "/home/davide/.config/GIMP/2.10/plug-ins/style-transfer/style-transfer.py", line 2, in <module>
   import gi as gi3
 File "/usr/lib/python2.7/dist-packages/gi/__init__.py", line 39, in <module>
   raise ImportError(_static_binding_error)
ImportError: When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject". See: https://bugzilla.gnome.org/show_bug.cgi?id=709183
Reply


Messages In This Thread
Python-fu plugin UI - by Davide_sd - 01-16-2019, 10:06 PM
RE: Python-fu plugin UI - by Ofnuts - 01-16-2019, 10:16 PM
RE: Python-fu plugin UI - by Davide_sd - 01-16-2019, 10:36 PM
RE: Python-fu plugin UI - by Ofnuts - 01-16-2019, 11:21 PM
RE: Python-fu plugin UI - by Davide_sd - 01-19-2019, 01:14 PM
RE: Python-fu plugin UI - by Ofnuts - 01-19-2019, 06:32 PM
RE: Python-fu plugin UI - by Davide_sd - 02-13-2019, 02:54 PM

Forum Jump: